[GRASS-SVN] r31260 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 5 16:28:56 EDT 2008


Author: martinl
Date: 2008-05-05 16:28:55 -0400 (Mon, 05 May 2008)
New Revision: 31260

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: loading/saving workspace fix (too many values to unpack)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-05-05 17:12:42 UTC (rev 31259)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-05-05 20:28:55 UTC (rev 31260)
@@ -1398,13 +1398,13 @@
                     cmd_validated.append(option)
                 else: # parameter
                     try:
-                        key, value = option.split('=')
+                        key, value = option.split('=', 1)
                     except:
                         if i == 0: # add key name of first parameter if not given
                             key = self.grass_task.firstParam
                             value = option
                         else:
-                            raise ValueError, _("Unable to parse command %s") % ''.join(cmd)
+                            raise ValueError, _("Unable to parse command %s") % ' '.join(cmd)
 
                     if self.grass_task.get_param(key)['element'] in ['cell', 'vector']:
                         # mapname -> mapname at mapset

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-05-05 17:12:42 UTC (rev 31259)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-05-05 20:28:55 UTC (rev 31260)
@@ -838,7 +838,7 @@
                         file.write('%s<flag name="%s" />\n' %
                                    (' ' * self.indent, option[1]))
                     else: # parameter
-                        key, value = option.split('=')
+                        key, value = option.split('=', 1)
                         file.write('%s<parameter name="%s">\n' %
                                    (' ' * self.indent, key))
                         self.indent += 4
@@ -917,8 +917,10 @@
             del self.indent
         except StandardError, e:
             file.close()
-            wx.MessageBox(parent=self, message=_("Writing current settings to workspace file failed (%s)." % e),
-                          caption=_("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+            wx.MessageBox(parent=self,
+                          message=_("Writing current settings to workspace file failed (%s)." % e),
+                          caption=_("Error"),
+                          style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
             return False
 
         file.close()



More information about the grass-commit mailing list