Skip to content

Commit dbbc988

Browse files
committedApr 10, 2013
[sextante] allow non-ASCII characters in string parameters
1 parent 4219eb1 commit dbbc988

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎python/plugins/sextante/parameters/ParameterString.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ def setValue(self, obj):
4040
if obj is None:
4141
self.value = self.default
4242
return True
43-
self.value = str(obj).replace(ParameterString.ESCAPED_NEWLINE,ParameterString.NEWLINE)
43+
self.value = unicode(obj).replace(ParameterString.ESCAPED_NEWLINE,ParameterString.NEWLINE)
4444
return True
4545

4646
def getValueAsCommandLineParameter(self):
47-
return "\"" + str(self.value.replace(ParameterString.NEWLINE,ParameterString.ESCAPED_NEWLINE)) + "\""
47+
return "\"" + unicode(self.value.replace(ParameterString.NEWLINE,ParameterString.ESCAPED_NEWLINE)) + "\""
4848

4949
def serialize(self):
5050
return self.__module__.split(".")[-1] + "|" + self.name + "|" + self.description +\
51-
"|" + str(self.default)
51+
"|" + unicode(self.default)
5252

5353
def deserialize(self, s):
5454
tokens = s.split("|")
5555
return ParameterString(tokens[0], tokens[1], tokens[2])
5656

5757
def getAsScriptCode(self):
58-
return "##" + self.name + "=string " + self.default
58+
return "##" + self.name + "=string " + self.default

0 commit comments

Comments
 (0)
Please sign in to comment.