Skip to content
Permalink
Browse files

Merge pull request #6309 from alexbruy/processing-enums

[processing] add enums support for fields and feature source parameters
  • Loading branch information
alexbruy committed Feb 11, 2018
2 parents 367aba1 + 1785093 commit c3a4b1170adb0db9e1de40bbeb8d8e79594ac9f5
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 c3a4b11

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