Skip to content
Permalink
Browse files

Merge pull request #6855 from m-kuhn/no-print

No print() usage in processing core
  • Loading branch information
m-kuhn committed Apr 25, 2018
2 parents d0130d2 + 5910ba9 commit 74704b60fb40f636525a12420e2628a0049e4ddc
Showing with 0 additions and 8 deletions.
  1. +0 −8 python/plugins/processing/core/Processing.py
@@ -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)
@@ -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)

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

0 comments on commit 74704b6

Please sign in to comment.
You can’t perform that action at this time.