[GRASS-SVN] r41050 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 16 14:11:40 EST 2010


Author: martinl
Date: 2010-02-16 14:11:39 -0500 (Tue, 16 Feb 2010)
New Revision: 41050

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/workspace.py
Log:
bugfix #926


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-02-16 18:41:12 UTC (rev 41049)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-02-16 19:11:39 UTC (rev 41050)
@@ -1836,7 +1836,10 @@
             cmd_validated = [cmd[0]]
             for option in cmd[1:]:
                 if option[0] == '-': # flag
-                    self.grass_task.set_flag(option[1], True)
+                    if option[1] == '-':
+                        self.grass_task.set_flag(option[2:], True)
+                    else:
+                        self.grass_task.set_flag(option[1], True)
                     cmd_validated.append(option)
                 else: # parameter
                     try:

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/workspace.py	2010-02-16 18:41:12 UTC (rev 41049)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/workspace.py	2010-02-16 19:11:39 UTC (rev 41050)
@@ -1,4 +1,4 @@
-"""
+"""!
 @package workspace.py
 
 @brief Open/save workspace definition file
@@ -9,7 +9,7 @@
  - WriteWorkspaceFile
  - ProcessGrcFile
 
-(C) 2007-2009 by the GRASS Development Team
+(C) 2007-2010 by the GRASS Development Team
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
@@ -153,12 +153,15 @@
             self.value = ''
 
         elif name == 'flag':
-            name = attrs.get('name', None)
-            self.cmd.append('-' + name)
-
+            flag = attrs.get('name', None)
+            if len(flag) > 1:
+                self.cmd.append('--' + flag)
+            else:
+                self.cmd.append('-' + flag)
+        
         elif name == 'selected':
             if self.inTag['layer']:
-                self.layerSelected = True;
+                self.layerSelected = True
 
         elif name == 'layer_manager':
             posAttr = attrs.get('dim', '')
@@ -713,8 +716,12 @@
                 self.indent += 4
                 for option in cmd[1:]:
                     if option[0] == '-': # flag
-                        self.file.write('%s<flag name="%s" />\n' %
-                                   (' ' * self.indent, option[1]))
+                        if option[1] == '-':
+                            self.file.write('%s<flag name="%s" />\n' %
+                                            (' ' * self.indent, option[2:]))
+                        else:
+                            self.file.write('%s<flag name="%s" />\n' %
+                                            (' ' * self.indent, option[1]))
                     else: # parameter
                         key, value = option.split('=', 1)
                         self.file.write('%s<parameter name="%s">\n' %



More information about the grass-commit mailing list