Skip to content

Commit 0a686c4

Browse files
committedDec 21, 2016
[processing] Make ParameterFixedTable scriptable
1 parent 2af00be commit 0a686c4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎python/plugins/processing/core/parameters.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,19 @@ def tableToString(table):
561561
tablestring = tablestring[:-1]
562562
return tablestring
563563

564+
def getAsScriptCode(self):
565+
param_type = ''
566+
if self.optional:
567+
param_type += 'optional '
568+
param_type += 'fixedtable'
569+
return '##' + self.name + '=' + param_type
570+
564571
@classmethod
565572
def fromScriptCode(self, line):
566573
isOptional, name, definition = _splitParameterOptions(line)
567-
if definition.startswith("point"):
574+
if definition.startswith("fixedtable"):
568575
descName = _createDescriptiveName(name)
569-
default = definition.strip()[len('point') + 1:] or None
576+
default = definition.strip()[len('fixedtable') + 1:] or None
570577
return ParameterFixedTable(name, descName, default, isOptional)
571578

572579

0 commit comments

Comments
 (0)
Please sign in to comment.