Quellcode durchsuchen

wxGUI: loading/saving workspace fix (too many values to unpack) [sync'ed with develbr6]

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@31261 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa vor 17 Jahren
Ursprung
Commit
b92d334b8c
2 geänderte Dateien mit 7 neuen und 5 gelöschten Zeilen
  1. 2 2
      gui/wxpython/gui_modules/menuform.py
  2. 5 3
      gui/wxpython/wxgui.py

+ 2 - 2
gui/wxpython/gui_modules/menuform.py

@@ -1398,13 +1398,13 @@ class GUI:
                     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@mapset

+ 5 - 3
gui/wxpython/wxgui.py

@@ -838,7 +838,7 @@ class GMFrame(wx.Frame):
                         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 @@ class GMFrame(wx.Frame):
             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()