[GRASS-SVN] r35762 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 4 18:02:51 EST 2009


Author: martinl
Date: 2009-02-04 18:02:50 -0500 (Wed, 04 Feb 2009)
New Revision: 35762

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
Log:
wxGUI: fix broken workspace


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2009-02-04 15:57:11 UTC (rev 35761)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2009-02-04 23:02:50 UTC (rev 35762)
@@ -208,7 +208,7 @@
                               flags = 'l')
     
         if ret:
-            mapsets = ret.rstrip('\n').split(' ')
+            mapsets = ret.rstrip('\n').strip().split(' ')
         else:
             raise gcmd.CmdError(cmd = 'g.mapsets',
                                 message = _('Unable to get list of available mapsets.'))
@@ -217,7 +217,7 @@
                               read = True,
                               flags = 'p')
         if ret:
-            mapsets = ret.rstrip('\n').split(' ')
+            mapsets = ret.rstrip('\n').strip().split(' ')
         else:
             raise gcmd.CmdError(cmd = 'g.mapsets',
                                 message = _('Unable to get list of accessible mapsets.'))

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py	2009-02-04 15:57:11 UTC (rev 35761)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py	2009-02-04 23:02:50 UTC (rev 35762)
@@ -439,17 +439,17 @@
                 # layer properties
                 self.file.write('%s<task name="%s">\n' % (' ' * self.indent, cmd[0]))
                 self.indent += 4
-                for option in cmd[1:]:
-                    if option[0] == '-': # flag
-                        self.file.write('%s<flag name="%s" />\n' %
-                                   (' ' * self.indent, option[1]))
+                for key, val in cmd[1].iteritems():
+                    if key == 'flags':
+                        for f in opt['flags']:
+                            self.file.write('%s<flag name="%s" />\n' %
+                                            (' ' * self.indent, f))
                     else: # parameter
-                        key, value = option.split('=', 1)
                         self.file.write('%s<parameter name="%s">\n' %
                                    (' ' * self.indent, key))
                         self.indent += 4
                         self.file.write('%s<value>%s</value>\n' %
-                                   (' ' * self.indent, value))
+                                   (' ' * self.indent, val))
                         self.indent -= 4
                         self.file.write('%s</parameter>\n' % (' ' * self.indent));
                 self.indent -= 4



More information about the grass-commit mailing list