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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 9 19:59:07 EDT 2011


Author: martinl
Date: 2011-08-09 16:59:06 -0700 (Tue, 09 Aug 2011)
New Revision: 47520

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcmd.py
   grass/trunk/gui/wxpython/gui_modules/render.py
Log:
wxGUI: be more verbose about errors in rendering


Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py	2011-08-09 23:47:02 UTC (rev 47519)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py	2011-08-09 23:59:06 UTC (rev 47520)
@@ -103,7 +103,7 @@
                       style = style)
 
 class GException(Exception):
-    def __init__(self, value):
+    def __init__(self, value = ''):
         self.value = value
 
     def __str__(self):

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2011-08-09 23:47:02 UTC (rev 47519)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2011-08-09 23:59:06 UTC (rev 47520)
@@ -153,12 +153,13 @@
                                            quiet = True,
                                            **self.cmd[1])
                 
+            if msg:
+                sys.stderr.write(_("Command '%s' failed\n") % self.GetCmd(string = True))
+                sys.stderr.write(_("Details: %s\n") % msg)
             if ret != 0:
-                raise gcmd.GException(value = _("'%(cmd)s' failed. Details: %(det)s") % \
-                                          { 'cmd' : self.cmd[0], 'det' : msg })
+                raise gcmd.GException()
         
-        except gcmd.GException, e:
-            print >> sys.stderr, e.value
+        except gcmd.GException:
             # clean up after problems
             for f in [self.mapfile, self.maskfile]:
                 if not f:



More information about the grass-commit mailing list