Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 3, 2015
1 parent abae441 commit e694474
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 92 deletions.
1 change: 0 additions & 1 deletion python/plugins/db_manager/db_plugins/data_model.py
Expand Up @@ -78,7 +78,6 @@ def data(self, index, role):
val = val[:300]
return unicode(val, 'utf-8', 'replace') # convert from utf8 and replace errors (if any)


def headerData(self, section, orientation, role):
if role != Qt.DisplayRole:
return None
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass/GrassAlgorithm.py
Expand Up @@ -307,7 +307,7 @@ def processAlgorithm(self, progress):
if isinstance(param, (ParameterRaster, ParameterVector)):
value = param.value
if value in self.exportedLayers.keys():
command += ' %s="%s"' %(param.name, self.exportedLayers[value])
command += ' %s="%s"' % (param.name, self.exportedLayers[value])
else:
command += ' %s="%s"' % (param.name, value)
elif isinstance(param, ParameterMultipleInput):
Expand Down
1 change: 0 additions & 1 deletion python/plugins/processing/algs/grass/GrassUtils.py
Expand Up @@ -238,7 +238,6 @@ def writeGrassWindow(filename):
out.write('n-s resol3: 1\n')
out.write('t-b resol: 1\n')


@staticmethod
def prepareGrassExecution(commands):
env = os.environ.copy()
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/processing/algs/otb/OTBUtils.py
Expand Up @@ -144,15 +144,14 @@ def executeOtb(commands, progress):

ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)


@staticmethod
def checkOtbConfiguration():
path = OTBUtils.otbPath()
libpath = OTBUtils.otbLibPath()
configurationOk = bool(path) and bool(libpath)
if not configurationOk:
return OTBUtils.tr('OTB folder is not configured. Please configure it '
'before running OTB algorithms.')
'before running OTB algorithms.')

@staticmethod
def tr(string, context=''):
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
Expand Up @@ -48,7 +48,6 @@ class SagaAlgorithmProvider(AlgorithmProvider):
"2.1.4": ("2.1.4", SagaAlgorithm214),
"2.2.0": ("2.2.0", SagaAlgorithm214)}


def __init__(self):
AlgorithmProvider.__init__(self)
self.activate = True
Expand Down Expand Up @@ -92,7 +91,7 @@ def _loadAlgorithms(self):
version = lastVersion
else:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with SAGA installation: installed SAGA version (%s) is not supported' % version))
self.tr('Problem with SAGA installation: installed SAGA version (%s) is not supported' % version))
return

folder = SagaUtils.sagaDescriptionPath()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/ProcessingLog.py
Expand Up @@ -70,7 +70,7 @@ def addToLog(msgtype, msg):
# to miss some log info that breaking the algorithm.
if msgtype == ProcessingLog.LOG_ALGORITHM:
line = msgtype + '|' + datetime.datetime.now().strftime(
ProcessingLog.DATE_FORMAT)+ '|' \
ProcessingLog.DATE_FORMAT) + '|' \
+ msg + '\n'
logfile = codecs.open(ProcessingLog.logFilename(), 'a',
encoding='utf-8')
Expand Down
1 change: 0 additions & 1 deletion python/plugins/processing/gui/AlgorithmDialogBase.py
Expand Up @@ -85,7 +85,6 @@ def __init__(self, alg):
self.showDebug = ProcessingConfig.getSetting(
ProcessingConfig.SHOW_DEBUG_IN_DIALOG)


def closeEvent(self, evt):
self.settings.setValue("/Processing/dialogBase", self.saveGeometry())

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/BatchOutputSelectionPanel.py
Expand Up @@ -78,8 +78,8 @@ def showSelectionDialog(self):
path = unicode(settings.value('/Processing/LastBatchOutputPath'))
else:
path = ''
filename, selectedFileFilter = QFileDialog.getSaveFileNameAndFilter(self,
self.tr('Save file'), path, filefilter)
filename, selectedFileFilter = QFileDialog.getSaveFileNameAndFilter(self,
self.tr('Save file'), path, filefilter)
print filename, selectedFileFilter
if filename:
if not filename.lower().endswith(
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/MessageBarProgress.py
Expand Up @@ -33,6 +33,7 @@
from processing.core.ProcessingLog import ProcessingLog
from processing.gui.MessageDialog import MessageDialog


class MessageBarProgress:

def __init__(self, algname=None):
Expand All @@ -49,7 +50,6 @@ def __init__(self, algname=None):
def error(self, msg):
self.msg.append(msg)


def setText(self, text):
pass

Expand Down
1 change: 0 additions & 1 deletion python/plugins/processing/gui/Postprocessing.py
Expand Up @@ -85,7 +85,6 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
msg += "You can check the log messages to find more information about the execution of the algorithm"
progress.error(msg)


if showResults and htmlResults and not wrongLayers:
dlg = ResultsDialog()
dlg.exec_()
Expand Down
22 changes: 11 additions & 11 deletions python/utils.py
Expand Up @@ -92,6 +92,7 @@ def showException(type, value, tb, msg, messagebar=False):
else:
open_stack_dialog(type, value, tb, msg)


def show_message_log(pop_error=True):
if pop_error:
iface.messageBar().popWidget()
Expand Down Expand Up @@ -135,16 +136,16 @@ def open_stack_dialog(type, value, tb, msg, pop_error=True):
qgis_label = QCoreApplication.translate('Python', 'QGIS version:')
pypath_label = QCoreApplication.translate('Python', 'Python Path:')
txt = txt.format(msg=msg,
main_error=main_error,
error=error,
version_label=version_label,
num=sys.version,
qgis_label=qgis_label,
qversion=QGis.QGIS_VERSION,
qgisrelease=QGis.QGIS_RELEASE_NAME,
devversion=QGis.QGIS_DEV_VERSION,
pypath_label=pypath_label,
pypath="".join("<li>{}</li>".format(path) for path in sys.path))
main_error=main_error,
error=error,
version_label=version_label,
num=sys.version,
qgis_label=qgis_label,
qversion=QGis.QGIS_VERSION,
qgisrelease=QGis.QGIS_RELEASE_NAME,
devversion=QGis.QGIS_DEV_VERSION,
pypath_label=pypath_label,
pypath="".join("<li>{}</li>".format(path) for path in sys.path))

txt = txt.replace(' ', '&nbsp; ') # preserve whitespaces for nicer output

Expand All @@ -154,7 +155,6 @@ def open_stack_dialog(type, value, tb, msg, pop_error=True):
dlg.showMessage()



def qgis_excepthook(type, value, tb):
showException(type, value, tb, None, messagebar=True)

Expand Down

0 comments on commit e694474

Please sign in to comment.