[GRASS-SVN] r49740 - grass/branches/develbranch_6/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 14 07:21:43 EST 2011


Author: martinl
Date: 2011-12-14 04:21:43 -0800 (Wed, 14 Dec 2011)
New Revision: 49740

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


Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py	2011-12-14 12:08:03 UTC (rev 49739)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py	2011-12-14 12:21:43 UTC (rev 49740)
@@ -1794,9 +1794,8 @@
             global _blackList
             self.grass_task = gtask.parse_interface(cmd[0],
                                                     blackList = _blackList)
-        except ValueError, e: #grass.ScriptError, e:
-            gcmd.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/branches/develbranch_6/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py	2011-12-14 12:08:03 UTC (rev 49739)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py	2011-12-14 12:21:43 UTC (rev 49740)
@@ -544,9 +544,11 @@
                         del os.environ["GRASS_REGION"]
                 
                 if len(command) == 1:
-                    task = gtask.parse_interface(command[0])
-                    # if not task.has_required():
-                    # task = None # run command
+                    try:
+                        task = gtask.parse_interface(command[0])
+                    except grass.ScriptError, e:
+                        print >> sys.stderr, e
+                        task = None
                 else:
                     task = None
                 
@@ -805,7 +807,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