Skip to content
Browse files
[processing] correctly export multiline strings as python parameters …
…from modeler

fixes #13830
  • Loading branch information
volaya committed Dec 15, 2015
1 parent 7fc6b07 commit 95b92c79608afda0709dcdf8e89ee40b81a51ec7
Showing with 1 addition and 1 deletion.
  1. +1 −1 python/plugins/processing/modeler/
@@ -133,7 +133,7 @@ def _toString(v):
if isinstance(v, (ValueFromInput, ValueFromOutput)):
return v.asPythonParameter()
elif isinstance(v, basestring):
return "'%s'" % v
return "\\n".join(("'%s'" % v).splitlines())

This comment has been minimized.

Copy link

m-kuhn Dec 15, 2015


I realize that it's not new code, but .format() should be preferred over %


Why would you not use it [.format()]?

  • not knowing about it (me before reading this)
  • having to be compatible with Python 2.5

elif isinstance(v, list):
return "[%s]" % ",".join([_toString(val) for val in v])

0 comments on commit 95b92c7

Please sign in to comment.