Skip to content

Commit

Permalink
[processing] fixes for representing input values in history
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 6, 2015
1 parent de15403 commit b3b3379
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/plugins/processing/core/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

def getParameterFromString(s):
tokens = s.split("|")
params = [t if unicode(t) != "None" else None for t in tokens[1:]]
params = [t if unicode(t) != unicode(None) else None for t in tokens[1:]]
clazz = getattr(sys.modules[__name__], tokens[0])
return clazz(*params)

Expand Down Expand Up @@ -484,7 +484,7 @@ def setValue(self, text):
return False

def getValueAsCommandLineParameter(self):
return '"' + unicode(self.value) + '"'
return '"' + unicode(self.value) + '"' if self.value is not None else unicode(None)


class ParameterRaster(ParameterDataObject):
Expand Down Expand Up @@ -605,8 +605,9 @@ def setValue(self, obj):
return True

def getValueAsCommandLineParameter(self):
return '"' + unicode(self.value.replace(ParameterString.NEWLINE,
return ('"' + unicode(self.value.replace(ParameterString.NEWLINE,
ParameterString.ESCAPED_NEWLINE)) + '"'
if self.value is not None else unicode(None))


class ParameterTable(ParameterDataObject):
Expand Down Expand Up @@ -688,7 +689,7 @@ def __init__(self, name='', description='', parent=None, datatype=-1,
self.datatype = int(datatype)

def getValueAsCommandLineParameter(self):
return '"' + unicode(self.value) + '"'
return '"' + unicode(self.value) + '"' if self.value is not None else unicode(None)

def setValue(self, value):
if value is None:
Expand Down

0 comments on commit b3b3379

Please sign in to comment.