Skip to content

Commit 837ee29

Browse files
committedApr 7, 2017
Indentation
1 parent 11d71d9 commit 837ee29

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed
 

‎python/plugins/processing/core/Processing.py

100644100755
Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from builtins import str
2121
from builtins import object
2222

23-
2423
__author__ = 'Victor Olaya'
2524
__date__ = 'August 2012'
2625
__copyright__ = '(C) 2012, Victor Olaya'
@@ -63,7 +62,6 @@
6362

6463

6564
class Processing(object):
66-
6765
BASIC_PROVIDERS = []
6866

6967
@staticmethod
@@ -121,7 +119,6 @@ def removeScripts(folder):
121119
provider.externalAlgs.remove(alg)
122120
provider.refreshAlgorithms()
123121

124-
125122
@staticmethod
126123
def runAlgorithm(algOrName, onFinish, *args, **kwargs):
127124
if isinstance(algOrName, GeoAlgorithm):
@@ -131,7 +128,8 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
131128
if alg is None:
132129
# fix_print_with_import
133130
print('Error: Algorithm not found\n')
134-
QgsMessageLog.logMessage(Processing.tr('Error: Algorithm {0} not found\n').format(algOrName), Processing.tr("Processing"))
131+
QgsMessageLog.logMessage(Processing.tr('Error: Algorithm {0} not found\n').format(algOrName),
132+
Processing.tr("Processing"))
135133
return
136134
alg = alg.getCopy()
137135

@@ -149,7 +147,9 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
149147
continue
150148
# fix_print_with_import
151149
print('Error: Wrong parameter value %s for parameter %s.' % (value, name))
152-
QgsMessageLog.logMessage(Processing.tr('Error: Wrong parameter value {0} for parameter {1}.').format(value, name), Processing.tr("Processing"))
150+
QgsMessageLog.logMessage(
151+
Processing.tr('Error: Wrong parameter value {0} for parameter {1}.').format(value, name),
152+
Processing.tr("Processing"))
153153
ProcessingLog.addToLog(
154154
ProcessingLog.LOG_ERROR,
155155
Processing.tr('Error in {0}. Wrong parameter value {1} for parameter {2}.').format(
@@ -163,7 +163,9 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
163163
if not param.setDefaultValue():
164164
# fix_print_with_import
165165
print('Error: Missing parameter value for parameter %s.' % param.name)
166-
QgsMessageLog.logMessage(Processing.tr('Error: Missing parameter value for parameter {0}.').format(param.name), Processing.tr("Processing"))
166+
QgsMessageLog.logMessage(
167+
Processing.tr('Error: Missing parameter value for parameter {0}.').format(param.name),
168+
Processing.tr("Processing"))
167169
ProcessingLog.addToLog(
168170
ProcessingLog.LOG_ERROR,
169171
Processing.tr('Error in {0}. Missing parameter value for parameter {1}.').format(
@@ -174,7 +176,8 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
174176
if len(args) != alg.getVisibleParametersCount() + alg.getVisibleOutputsCount():
175177
# fix_print_with_import
176178
print('Error: Wrong number of parameters')
177-
QgsMessageLog.logMessage(Processing.tr('Error: Wrong number of parameters'), Processing.tr("Processing"))
179+
QgsMessageLog.logMessage(Processing.tr('Error: Wrong number of parameters'),
180+
Processing.tr("Processing"))
178181
processing.algorithmHelp(algOrName)
179182
return
180183
i = 0
@@ -183,7 +186,8 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
183186
if not param.setValue(args[i]):
184187
# fix_print_with_import
185188
print('Error: Wrong parameter value: ' + str(args[i]))
186-
QgsMessageLog.logMessage(Processing.tr('Error: Wrong parameter value: ') + str(args[i]), Processing.tr("Processing"))
189+
QgsMessageLog.logMessage(Processing.tr('Error: Wrong parameter value: ') + str(args[i]),
190+
Processing.tr("Processing"))
187191
return
188192
i = i + 1
189193

@@ -192,21 +196,25 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
192196
if not output.setValue(args[i]):
193197
# fix_print_with_import
194198
print('Error: Wrong output value: ' + str(args[i]))
195-
QgsMessageLog.logMessage(Processing.tr('Error: Wrong output value: ') + str(args[i]), Processing.tr("Processing"))
199+
QgsMessageLog.logMessage(Processing.tr('Error: Wrong output value: ') + str(args[i]),
200+
Processing.tr("Processing"))
196201
return
197202
i = i + 1
198203

199204
msg = alg._checkParameterValuesBeforeExecuting()
200205
if msg:
201206
# fix_print_with_import
202207
print('Unable to execute algorithm\n' + str(msg))
203-
QgsMessageLog.logMessage(Processing.tr('Unable to execute algorithm\n{0}').format(msg), Processing.tr("Processing"))
208+
QgsMessageLog.logMessage(Processing.tr('Unable to execute algorithm\n{0}').format(msg),
209+
Processing.tr("Processing"))
204210
return
205211

206212
if not alg.checkInputCRS():
207213
print('Warning: Not all input layers use the same CRS.\n' +
208214
'This can cause unexpected results.')
209-
QgsMessageLog.logMessage(Processing.tr('Warning: Not all input layers use the same CRS.\nThis can cause unexpected results.'), Processing.tr("Processing"))
215+
QgsMessageLog.logMessage(
216+
Processing.tr('Warning: Not all input layers use the same CRS.\nThis can cause unexpected results.'),
217+
Processing.tr("Processing"))
210218

211219
# Don't set the wait cursor twice, because then when you
212220
# restore it, it will still be a wait cursor.
@@ -231,7 +239,8 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
231239
if onFinish is not None:
232240
onFinish(alg, feedback)
233241
else:
234-
QgsMessageLog.logMessage(Processing.tr("There were errors executing the algorithm."), Processing.tr("Processing"))
242+
QgsMessageLog.logMessage(Processing.tr("There were errors executing the algorithm."),
243+
Processing.tr("Processing"))
235244

236245
if overrideCursor:
237246
QApplication.restoreOverrideCursor()

0 commit comments

Comments
 (0)
Please sign in to comment.