[GRASS-SVN] r39793 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 23 17:13:15 EST 2009


Author: martinl
Date: 2009-11-23 17:13:15 -0500 (Mon, 23 Nov 2009)
New Revision: 39793

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: fix menuform
       (merge r39792 from devbr6)


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2009-11-23 22:07:23 UTC (rev 39792)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2009-11-23 22:13:15 UTC (rev 39793)
@@ -53,6 +53,7 @@
 import types
 import copy
 import locale
+import types
 from threading import Thread
 import Queue
 
@@ -370,12 +371,17 @@
         try:
             for p in self.params:
                 val = p[element]
+                if val is None:
+                    continue
                 if type(val) in (types.ListType, types.TupleType):
                     if value in val:
                         return p
-                else:
+                elif type(val) == types.StringType:
                     if p[element][:len(value)] == value:
                         return p
+                else:
+                    if p[element] == value:
+                        return p
         except KeyError:
             pass
         
@@ -1866,7 +1872,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
 
@@ -1969,6 +1980,8 @@
             else:
                 self.mf.OnApply(None)
         
+        self.cmd = cmd
+        
         return self.grass_task
 
     def GetCommandInputMapParamKey(self, cmd):

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2009-11-23 22:07:23 UTC (rev 39792)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2009-11-23 22:13:15 UTC (rev 39793)
@@ -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