Skip to content

Commit b3b3379

Browse files
committed
[processing] fixes for representing input values in history
1 parent de15403 commit b3b3379

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/plugins/processing/core/parameters.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

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

@@ -484,7 +484,7 @@ def setValue(self, text):
484484
return False
485485

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

489489

490490
class ParameterRaster(ParameterDataObject):
@@ -605,8 +605,9 @@ def setValue(self, obj):
605605
return True
606606

607607
def getValueAsCommandLineParameter(self):
608-
return '"' + unicode(self.value.replace(ParameterString.NEWLINE,
608+
return ('"' + unicode(self.value.replace(ParameterString.NEWLINE,
609609
ParameterString.ESCAPED_NEWLINE)) + '"'
610+
if self.value is not None else unicode(None))
610611

611612

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

690691
def getValueAsCommandLineParameter(self):
691-
return '"' + unicode(self.value) + '"'
692+
return '"' + unicode(self.value) + '"' if self.value is not None else unicode(None)
692693

693694
def setValue(self, value):
694695
if value is None:

0 commit comments

Comments
 (0)