[GRASS-SVN] r49741 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 14 07:32:15 EST 2011


Author: martinl
Date: 2011-12-14 04:32:15 -0800 (Wed, 14 Dec 2011)
New Revision: 49741

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
   grass/trunk/gui/wxpython/gui_core/goutput.py
Log:
wxGUI: better error handling when command is not available


Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2011-12-14 12:21:43 UTC (rev 49740)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2011-12-14 12:32:15 UTC (rev 49741)
@@ -1968,9 +1968,8 @@
             global _blackList
             self.grass_task = gtask.parse_interface(cmd[0],
                                                     blackList = _blackList)
-        except ValueError, e: #grass.ScriptError, e:
-            GError(e.value)
-            return
+        except (grass.ScriptError, ValueError), e: 
+            raise gcmd.GException(e.value)
         
         # if layer parameters previously set, re-insert them into dialog
         if completed is not None:

Modified: grass/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py	2011-12-14 12:21:43 UTC (rev 49740)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py	2011-12-14 12:32:15 UTC (rev 49741)
@@ -537,7 +537,10 @@
                 # other GRASS commands (r|v|g|...)
                 if len(command) == 1 and command[0] != 'v.krige':
                     # no arguments given
-                    GUI(parent = self).ParseCommand(command)
+                    try:
+                        GUI(parent = self).ParseCommand(command)
+                    except GException, e:
+                        print >> sys.stderr, e
                     return 0
                 
                 task = GUI(show = None).ParseCommand(command)
@@ -818,7 +821,8 @@
             
             try:
                 task = GUI(show = None).ParseCommand(event.cmd)
-            except GException:
+            except GException, e:
+                print >> sys.stderr, e
                 task = None
                 return
             



More information about the grass-commit mailing list