|
39 | 39 |
|
40 | 40 | def getParameterFromString(s):
|
41 | 41 | 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:]] |
43 | 43 | clazz = getattr(sys.modules[__name__], tokens[0])
|
44 | 44 | return clazz(*params)
|
45 | 45 |
|
@@ -484,7 +484,7 @@ def setValue(self, text):
|
484 | 484 | return False
|
485 | 485 |
|
486 | 486 | def getValueAsCommandLineParameter(self):
|
487 |
| - return '"' + unicode(self.value) + '"' |
| 487 | + return '"' + unicode(self.value) + '"' if self.value is not None else unicode(None) |
488 | 488 |
|
489 | 489 |
|
490 | 490 | class ParameterRaster(ParameterDataObject):
|
@@ -605,8 +605,9 @@ def setValue(self, obj):
|
605 | 605 | return True
|
606 | 606 |
|
607 | 607 | def getValueAsCommandLineParameter(self):
|
608 |
| - return '"' + unicode(self.value.replace(ParameterString.NEWLINE, |
| 608 | + return ('"' + unicode(self.value.replace(ParameterString.NEWLINE, |
609 | 609 | ParameterString.ESCAPED_NEWLINE)) + '"'
|
| 610 | + if self.value is not None else unicode(None)) |
610 | 611 |
|
611 | 612 |
|
612 | 613 | class ParameterTable(ParameterDataObject):
|
@@ -688,7 +689,7 @@ def __init__(self, name='', description='', parent=None, datatype=-1,
|
688 | 689 | self.datatype = int(datatype)
|
689 | 690 |
|
690 | 691 | def getValueAsCommandLineParameter(self):
|
691 |
| - return '"' + unicode(self.value) + '"' |
| 692 | + return '"' + unicode(self.value) + '"' if self.value is not None else unicode(None) |
692 | 693 |
|
693 | 694 | def setValue(self, value):
|
694 | 695 | if value is None:
|
|
0 commit comments