[GRASS-SVN] r49739 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 14 07:08:03 EST 2011


Author: martinl
Date: 2011-12-14 04:08:03 -0800 (Wed, 14 Dec 2011)
New Revision: 49739

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: better error handling when command is not available


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py	2011-12-14 11:57:31 UTC (rev 49738)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py	2011-12-14 12:08:03 UTC (rev 49739)
@@ -533,10 +533,9 @@
                     import menuform
                     try:
                         task = gtask.parse_interface(command[0])
-                    except gcmd.ScriptError, e:
+                    except grass.ScriptError, e:
                         print >> sys.stderr, e
-                    # if not task.has_required():
-                    # task = None # run command
+                        task = None
                 else:
                     task = None
                 
@@ -781,7 +780,8 @@
             
             try:
                 task = menuform.GUI(show = None).ParseCommand(event.cmd)
-            except gcmd.GException:
+            except gcmd.GException, e:
+                print >> sys.stderr, e
                 task = None
                 return
             

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2011-12-14 11:57:31 UTC (rev 49738)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2011-12-14 12:08:03 UTC (rev 49739)
@@ -1730,8 +1730,8 @@
             global _blackList
             self.grass_task = gtask.parse_interface(cmd[0],
                                                     blackList = _blackList)
-        except ValueError, e: #grass.ScriptError, e:
-            gcmd.GError(e.value)
+        except (grass.ScriptError, ValueError), e:
+            raise gcmd.GException(e.value)
             return
         
         # if layer parameters previously set, re-insert them into dialog



More information about the grass-commit mailing list