[GRASS-SVN] r39792 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 23 17:07:25 EST 2009
Author: martinl
Date: 2009-11-23 17:07:23 -0500 (Mon, 23 Nov 2009)
New Revision: 39792
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: fix menuform
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2009-11-23 10:33:03 UTC (rev 39791)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2009-11-23 22:07:23 UTC (rev 39792)
@@ -52,6 +52,7 @@
import time
import copy
import locale
+import types
from threading import Thread
import Queue
@@ -331,8 +332,14 @@
def get_param(self, value, element='name', raiseError=True):
"""!Find and return a param by name."""
for p in self.params:
- if p[element][:len(value)] == value:
- return p
+ if p[element] is None:
+ continue
+ if type(value) == types.StringType:
+ if p[element][:len(value)] == value:
+ return p
+ else:
+ if p[element] == value:
+ return p
if raiseError:
raise ValueError, _("Parameter not found: %s") % \
value
@@ -1698,7 +1705,12 @@
def __init__(self, parent=-1):
self.parent = parent
self.grass_task = None
+ self.cmd = list()
+ def GetCmd(self):
+ """Get validated command"""
+ return self.cmd
+
def ParseInterface(self, cmd, parser = processTask):
"""!Parse interface
@@ -1801,6 +1813,8 @@
else:
self.mf.OnApply(None)
+ self.cmd = cmd
+
return self.grass_task
def GetCommandInputMapParamKey(self, cmd):
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py 2009-11-23 10:33:03 UTC (rev 39791)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py 2009-11-23 22:07:23 UTC (rev 39792)
@@ -846,10 +846,12 @@
ltype)
if self.GetPyData(layer)[0]['cmd']:
- cmdValidated = menuform.GUI().ParseCommand(self.GetPyData(layer)[0]['cmd'],
- completed=(self.GetOptData,layer,params),
- parentframe=self, show=show)
- self.GetPyData(layer)[0]['cmd'] = cmdValidated
+ module = menuform.GUI()
+ module.ParseCommand(self.GetPyData(layer)[0]['cmd'],
+ completed=(self.GetOptData,layer,params),
+ parentframe=self, show=show)
+
+ self.GetPyData(layer)[0]['cmd'] = module.GetCmd()
elif ltype == 'raster':
cmd = ['d.rast']
More information about the grass-commit
mailing list