[GRASS-SVN] r67835 - grass/branches/releasebranch_7_0/gui/wxpython/gmodeler
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 15 13:48:43 PST 2016
Author: martinl
Date: 2016-02-15 13:48:43 -0800 (Mon, 15 Feb 2016)
New Revision: 67835
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
Log:
wxGUI: modeler problems with variable (#2782)
(merge r67470 from trunk)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py 2016-02-15 14:42:47 UTC (rev 67834)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py 2016-02-15 21:48:43 UTC (rev 67835)
@@ -2521,15 +2521,15 @@
"""
result = ''
ss = re.split("\w*(%"+variable+")w*", string)
-
- if not ss[0]:
+
+ if not ss[0] and not ss[-1]:
if data:
return "options['%s']" % variable
else:
return variable
for s in ss:
- if s == '"':
+ if not s or s == '"':
continue
if s == '%' + variable:
@@ -2538,7 +2538,9 @@
else:
result += '+%s+' % variable
else:
- result += '"' + s + '"'
+ result += '"' + s
+ if not s.endswith(']'): # options
+ result += '"'
return result.strip('+')
More information about the grass-commit
mailing list