[GRASS-SVN] r30355 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 26 06:53:44 EST 2008


Author: martinl
Date: 2008-02-26 06:53:43 -0500 (Tue, 26 Feb 2008)
New Revision: 30355

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcmd.py
   grass/trunk/gui/wxpython/gui_modules/render.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: error handling fixed, use -s flag for d.vect.thematic by default

Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py	2008-02-26 05:13:44 UTC (rev 30354)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py	2008-02-26 11:53:43 UTC (rev 30355)
@@ -67,7 +67,8 @@
     See Command class (command exits with EXIT_FAILURE,
     G_fatal_error() is called)."""
     def __init__(self, cmd, message):
-        GException.__init__(self, message, title=_("Error in command execution"))
+        self.cmd = cmd
+        GException.__init__(self, message, title=_("Error in command execution %s" % self.cmd[0]))
 
 class SettingsError(GException):
     """Exception used for GRASS settings, see
@@ -269,11 +270,12 @@
             if rerr is not None and self.returncode != 0:
                 if rerr is False: # GUI dialog
                     try:
-                        raise CmdError, _("Execution failed: '%s'%s%s" 
-                                          "Details:%s%s") % (' '.join(self.cmd),
-                                                             os.linesep, os.linesep,
-                                                             os.linesep,
-                                                             self.PrintModuleOutput())
+                        raise CmdError(cmd=self.cmd,
+                                       message=_("Execution failed: '%s'%s%s" 
+                                                 "Details:%s%s") % (' '.join(self.cmd),
+                                                                    os.linesep, os.linesep,
+                                                                    os.linesep,
+                                                                    self.PrintModuleOutput()))
                     except CmdError, e:
                         print e
                 elif rerr == sys.stderr: # redirect message to sys
@@ -480,8 +482,9 @@
         if self.stderr:
             line = self.__read_all(self.module.stderr)
             self.stderr.write(line)
-            self.rerr = self.__parseString(line)
-        
+
+        self.rerr = self.__parseString(line)
+
     def __parseString(self, string):
         """Parse line
 

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2008-02-26 05:13:44 UTC (rev 30354)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2008-02-26 11:53:43 UTC (rev 30355)
@@ -110,7 +110,7 @@
         #
         try:
             runcmd = gcmd.Command(cmd=self.cmdlist + ['--q'])
-        except gcmd.CommandError, e:
+        except gcmd.CmdError, e:
             print e
         
         if runcmd.returncode != 0:

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-02-26 05:13:44 UTC (rev 30354)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-02-26 11:53:43 UTC (rev 30355)
@@ -579,7 +579,9 @@
             menuform.GUI().ParseCommand(['d.vect'], completed=(self.GetOptData,layer,params),
                                         parentframe=self)
         elif ltype == 'thememap':
-            menuform.GUI().ParseCommand(['d.vect.thematic'],
+            # -s flag requested, otherwise only first thematic category is displayed
+            # should be fixed by C-based d.thematic.* modules
+            menuform.GUI().ParseCommand(['d.vect.thematic', '-s'], 
                                         completed=(self.GetOptData,layer,params),
                                         parentframe=self)
         elif ltype == 'themechart':



More information about the grass-commit mailing list