Skip to content
Permalink
Browse files

[processing] Show accepted data types for parameters in processing.al…

…gorithmHelp
  • Loading branch information
nyalldawson committed May 29, 2018
1 parent 0bbaa3b commit db916bc238082db27d1771a0d55839f40dd86edd
Showing with 10 additions and 1 deletion.
  1. +10 −1 python/plugins/processing/tools/general.py
@@ -64,7 +64,16 @@ def algorithmHelp(id):
if isinstance(p, QgsProcessingParameterEnum):
opts = []
for i, o in enumerate(p.options()):
opts.append('\t\t{} - {}'.format(i, o))
opts.append('\t\t- {}: {}'.format(i, o))
print('\n\tAvailable values:\n{}'.format('\n'.join(opts)))

parameter_type = QgsApplication.processingRegistry().parameterType(p.type())
accepted_types = parameter_type.acceptedPythonTypes() if parameter_type is not None else []
if accepted_types:
opts = []
for t in accepted_types:
opts.append('\t\t- {}'.format(t))
print('\n\tAccepted data types:')
print('\n'.join(opts))

print('\n----------------')

0 comments on commit db916bc

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