Ver código fonte

wxGUI: be more verbose about errors in rendering

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47520 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 anos atrás
pai
commit
32e79c7d95

+ 1 - 1
gui/wxpython/gui_modules/gcmd.py

@@ -103,7 +103,7 @@ class GMessage:
                       style = style)
 
 class GException(Exception):
-    def __init__(self, value):
+    def __init__(self, value = ''):
         self.value = value
 
     def __str__(self):

+ 5 - 4
gui/wxpython/gui_modules/render.py

@@ -153,12 +153,13 @@ class Layer(object):
                                            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: