[GRASS-SVN] r69451 - grass/branches/releasebranch_7_2/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 11 20:06:33 PDT 2016


Author: annakrat
Date: 2016-09-11 20:06:33 -0700 (Sun, 11 Sep 2016)
New Revision: 69451

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py
Log:
wxGUI: fix saving long flags of overlays to workspace, see #3131 (merge from trunk, r69450)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py	2016-09-12 03:05:28 UTC (rev 69450)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py	2016-09-12 03:06:33 UTC (rev 69451)
@@ -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