Skip to content
Permalink
Browse files

[processing] add enums support for fields and feature source parameters

(follow up 068d74d)
  • Loading branch information
alexbruy committed Feb 11, 2018
1 parent 367aba1 commit 178509347afdce24acd3800c39b1fa93941a0e2e
Showing with 10 additions and 2 deletions.
  1. +10 −2 python/plugins/processing/core/parameters.py
@@ -118,7 +118,10 @@ def getParameterFromString(s):
params[5] = True if params[5].lower() == 'true' else False
elif clazz == QgsProcessingParameterFeatureSource:
if len(params) > 2:
params[2] = [int(p) for p in params[2].split(';')]
try:
params[2] = [int(p) for p in params[2].split(';')]
except:
params[2] = [getattr(QgsProcessing, p.split(".")[1]) for p in params[2].split(';')]
if len(params) > 4:
params[4] = True if params[4].lower() == 'true' else False
elif clazz == QgsProcessingParameterMultipleLayers:
@@ -136,9 +139,14 @@ def getParameterFromString(s):
params[3] = True if params[3].lower() == 'true' else False
if len(params) > 4:
params[4] = params[4].split(';')
if len(params) > 6:
params[6] = True if params[6].lower() == 'true' else False
elif clazz == QgsProcessingParameterField:
if len(params) > 4:
params[4] = int(params[4])
try:
params[4] = int(params[4])
except:
params[4] = getattr(QgsProcessingParameterField, params[4].split(".")[1])
if len(params) > 5:
params[5] = True if params[5].lower() == 'true' else False
if len(params) > 6:

0 comments on commit 1785093

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