[GRASS-SVN] r48599 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Oct 2 17:22:11 EDT 2011
Author: martinl
Date: 2011-10-02 14:22:11 -0700 (Sun, 02 Oct 2011)
New Revision: 48599
Modified:
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: fix running `d.* --help`
add d.redraw to supported commands
Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2011-10-02 21:16:33 UTC (rev 48598)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2011-10-02 21:22:11 UTC (rev 48599)
@@ -480,7 +480,7 @@
# except display commands (they are handled differently)
if self.parent.GetName() == "LayerManager" and \
command[0][0:2] == "d." and \
- (len(command) > 1 and 'help' not in ' '.join(command[1:])):
+ 'help' not in ' '.join(command[1:]):
# display GRASS commands
try:
layertype = {'d.rast' : 'raster',
@@ -499,7 +499,8 @@
'd.geodesic' : 'geodesic',
'd.rhumbline' : 'rhumb',
'd.labels' : 'labels',
- 'd.barscale' : 'barscale'}[command[0]]
+ 'd.barscale' : 'barscale',
+ 'd.redraw' : 'redraw'}[command[0]]
except KeyError:
gcmd.GMessage(parent = self.parent,
message = _("Command '%s' not yet implemented in the WxGUI. "
@@ -510,6 +511,8 @@
self.parent.curr_page.maptree.GetMapDisplay().OnAddBarscale(None)
elif layertype == 'rastleg':
self.parent.curr_page.maptree.GetMapDisplay().OnAddLegend(None)
+ elif layertype == 'redraw':
+ self.parent.curr_page.maptree.GetMapDisplay().OnRender(None)
else:
# add layer into layer tree
lname, found = utils.GetLayerNameFromCmd(command, fullyQualified = True,
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2011-10-02 21:16:33 UTC (rev 48598)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2011-10-02 21:22:11 UTC (rev 48599)
@@ -1938,11 +1938,14 @@
try:
key, value = option.split('=', 1)
except:
- if i == 0: # add key name of first parameter if not given
- key = self.grass_task.firstParam
- value = option
+ if self.grass_task.firstParam:
+ if i == 0: # add key name of first parameter if not given
+ key = self.grass_task.firstParam
+ value = option
+ else:
+ raise gcmd.GException, _("Unable to parse command '%s'") % ' '.join(cmd)
else:
- raise gcmd.GException, _("Unable to parse command '%s'") % ' '.join(cmd)
+ continue
element = self.grass_task.get_param(key, raiseError = False)
if not element:
More information about the grass-commit
mailing list