small python change

This commit is contained in:
Etienne Trimaille 2015-07-09 14:41:00 +02:00
parent a9e9f86f37
commit e751592a4d
4 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ from qgis.core import QgsVectorFileWriter
from processing.core.ProcessingConfig import Setting, ProcessingConfig
class AlgorithmProvider:
class AlgorithmProvider(object):
"""This is the base class for algorithms providers.
An algorithm provider is a set of related algorithms, typically

View File

@ -142,7 +142,7 @@ class GeoAlgorithm:
return False, helpUrl
def processAlgorithm(self):
def processAlgorithm(self, progress):
"""Here goes the algorithm itself.
There is no return value from this method.
@ -229,10 +229,10 @@ class GeoAlgorithm:
progress.setPercentage(100)
self.convertUnsupportedFormats(progress)
self.runPostExecutionScript(progress)
except GeoAlgorithmExecutionException, gaee:
except GeoAlgorithmExecutionException as gaee:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, gaee.msg)
raise gaee
except Exception, e:
except Exception as e:
# If something goes wrong and is not caught in the
# algorithm, we catch it here and wrap it
lines = [self.tr('Uncaught error while executing algorithm')]

View File

@ -50,7 +50,7 @@ def runalg(alg, progress=None):
try:
alg.execute(progress)
return True
except GeoAlgorithmExecutionException, e:
except GeoAlgorithmExecutionException as e:
ProcessingLog.addToLog(sys.exc_info()[0], ProcessingLog.LOG_ERROR)
progress.error(e.msg)
return False

View File

@ -26,7 +26,7 @@ __copyright__ = '(C) 2013, Victor Olaya'
__revision__ = '$Format:%H$'
class SilentProgress:
class SilentProgress(object):
def error(self, msg):
print msg