Skip to content

Commit

Permalink
[processing] Make ParameterFixedTable scriptable
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 21, 2016
1 parent 2af00be commit 0a686c4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/plugins/processing/core/parameters.py
Expand Up @@ -561,12 +561,19 @@ def tableToString(table):
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)


Expand Down

0 comments on commit 0a686c4

Please sign in to comment.