From 0a686c4fca64facbf7e67adb51c838764d6d44a6 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 21 Dec 2016 13:44:00 +0100 Subject: [PATCH] [processing] Make ParameterFixedTable scriptable --- python/plugins/processing/core/parameters.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/plugins/processing/core/parameters.py b/python/plugins/processing/core/parameters.py index 6aec7a4e287..af31e227763 100644 --- a/python/plugins/processing/core/parameters.py +++ b/python/plugins/processing/core/parameters.py @@ -561,12 +561,19 @@ class ParameterFixedTable(Parameter): tablestring = tablestring[:-1] return tablestring + def getAsScriptCode(self): + param_type = '' + if self.optional: + param_type += 'optional ' + param_type += 'fixedtable' + return '##' + self.name + '=' + param_type + @classmethod def fromScriptCode(self, line): isOptional, name, definition = _splitParameterOptions(line) - if definition.startswith("point"): + if definition.startswith("fixedtable"): descName = _createDescriptiveName(name) - default = definition.strip()[len('point') + 1:] or None + default = definition.strip()[len('fixedtable') + 1:] or None return ParameterFixedTable(name, descName, default, isOptional)