Skip to content

Commit

Permalink
No print() usage in processing core
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 25, 2018
1 parent b64a958 commit 5910ba9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions python/plugins/processing/core/Processing.py
Expand Up @@ -120,8 +120,6 @@ def runAlgorithm(algOrName, parameters, onFinish=None, feedback=None, context=No
feedback = QgsProcessingFeedback()

if alg is None:
# fix_print_with_import
print('Error: Algorithm not found\n')
msg = Processing.tr('Error: Algorithm {0} not found\n').format(algOrName)
feedback.reportError(msg)
raise QgsProcessingException(msg)
Expand All @@ -130,9 +128,7 @@ def runAlgorithm(algOrName, parameters, onFinish=None, feedback=None, context=No
for param in alg.parameterDefinitions():
if param.name() not in parameters:
if not param.flags() & QgsProcessingParameterDefinition.FlagOptional:
# fix_print_with_import
msg = Processing.tr('Error: Missing parameter value for parameter {0}.').format(param.name())
print('Error: Missing parameter value for parameter %s.' % param.name())
feedback.reportError(msg)
raise QgsProcessingException(msg)

Expand All @@ -141,15 +137,11 @@ def runAlgorithm(algOrName, parameters, onFinish=None, feedback=None, context=No

ok, msg = alg.checkParameterValues(parameters, context)
if not ok:
# fix_print_with_import
print('Unable to execute algorithm\n' + str(msg))
msg = Processing.tr('Unable to execute algorithm\n{0}').format(msg)
feedback.reportError(msg)
raise QgsProcessingException(msg)

if not alg.validateInputCrs(parameters, context):
print('Warning: Not all input layers use the same CRS.\n' +
'This can cause unexpected results.')
feedback.pushInfo(
Processing.tr('Warning: Not all input layers use the same CRS.\nThis can cause unexpected results.'))

Expand Down

0 comments on commit 5910ba9

Please sign in to comment.