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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 13 09:45:18 EST 2010


Author: martinl
Date: 2010-12-13 06:45:18 -0800 (Mon, 13 Dec 2010)
New Revision: 44591

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: catch errors from the prompt
(merge r44589 from devbr6)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py	2010-12-13 14:43:40 UTC (rev 44590)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py	2010-12-13 14:45:18 UTC (rev 44591)
@@ -733,7 +733,12 @@
                             display.GetRender().GetListOfLayers(l_type = 'raster') +
                             display.GetRender().GetListOfLayers(l_type = 'vector'))
             
-            task = menuform.GUI().ParseCommand(event.cmd, show = None)
+            try:
+                task = menuform.GUI().ParseCommand(event.cmd, show = None)
+            except gcmd.GException:
+                task = None
+                return
+            
             for p in task.get_options()['params']:
                 if p.get('prompt', '') not in ('raster', 'vector'):
                     continue

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-12-13 14:43:40 UTC (rev 44590)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-12-13 14:45:18 UTC (rev 44591)
@@ -2074,7 +2074,7 @@
                             key = self.grass_task.get_options()['params'][0]['name']
                             value = option
                         else:
-                            raise ValueError, _("Unable to parse command %s") % ' '.join(cmd)
+                            raise gcmd.GException, _("Unable to parse command %s") % ' '.join(cmd)
                     
                     element = self.grass_task.get_param(key, raiseError = False)
                     if not element:

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py	2010-12-13 14:43:40 UTC (rev 44590)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py	2010-12-13 14:45:18 UTC (rev 44591)
@@ -902,7 +902,7 @@
             self.InsertText(pos, '-')
             self.CharRight()
             self.toComplete = self.EntityToComplete()
-            if self.toComplete['entity'] == 'flags':
+            if self.toComplete['entity'] == 'flags' and self.cmdDesc:
                 if self.GetTextLeft()[-2:] == ' -': # complete e.g. --quite
                     for flag in self.cmdDesc.get_options()['flags']:
                         if len(flag['name']) == 1:



More information about the grass-commit mailing list