[GRASS-SVN] r44590 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 13 09:43:41 EST 2010
Author: martinl
Date: 2010-12-13 06:43:40 -0800 (Mon, 13 Dec 2010)
New Revision: 44590
Modified:
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: catch errors from the prompt
(merge r44589 from devbr6)
Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-12-13 14:30:22 UTC (rev 44589)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-12-13 14:43:40 UTC (rev 44590)
@@ -735,7 +735,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/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-12-13 14:30:22 UTC (rev 44589)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-12-13 14:43:40 UTC (rev 44590)
@@ -2247,7 +2247,7 @@
key = self.grass_task.firstParam
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/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py 2010-12-13 14:30:22 UTC (rev 44589)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py 2010-12-13 14:43:40 UTC (rev 44590)
@@ -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