[GRASS-SVN] r69450 - grass/trunk/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 11 20:05:28 PDT 2016
Author: annakrat
Date: 2016-09-11 20:05:28 -0700 (Sun, 11 Sep 2016)
New Revision: 69450
Modified:
grass/trunk/gui/wxpython/core/workspace.py
Log:
wxGUI: fix saving long flags of overlays to workspace, see #3131
Modified: grass/trunk/gui/wxpython/core/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/core/workspace.py 2016-09-12 02:33:19 UTC (rev 69449)
+++ grass/trunk/gui/wxpython/core/workspace.py 2016-09-12 03:05:28 UTC (rev 69450)
@@ -1537,9 +1537,15 @@
self.file.write('%s<overlay name="%s">\n' % (' ' * self.indent, cmd[0]))
self.indent += 4
for prm in cmd[1:]:
- if prm[0] == "-":
- for i in range(1, len(prm)):
- self.file.write('%s<flag name="%s" />\n' % (' ' * self.indent, prm[i]))
+ if prm.startswith('-'):
+ flags = []
+ if prm.startswith('--'):
+ flags.append(prm[2:])
+ else:
+ flags = list(prm[1:])
+ for f in flags:
+ self.file.write('%s<flag name="%s" />\n' % (' ' * self.indent, f))
+
elif prm.startswith("at="):
# legend "at" argument takes 4 numbers not 2
if cmd[0] == "d.legend":
More information about the grass-commit
mailing list