Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed Oct 3, 2015
1 parent abae441 commit e694474f62f2ece7f6bd2b1391066eeefe6b7174
@@ -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
@@ -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):
@@ -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()
@@ -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=''):
@@ -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
@@ -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()
@@ -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')
@@ -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())

@@ -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(
@@ -33,6 +33,7 @@
from processing.core.ProcessingLog import ProcessingLog
from processing.gui.MessageDialog import MessageDialog


class MessageBarProgress:

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


def setText(self, text):
pass

@@ -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_()
@@ -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()
@@ -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

@@ -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)

0 comments on commit e694474

Please sign in to comment.