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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 24 10:06:59 EDT 2009


Author: martinl
Date: 2009-05-24 10:06:59 -0400 (Sun, 24 May 2009)
New Revision: 37423

Modified:
   grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI/prompt: parse only GRASS modules


Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-05-24 14:02:43 UTC (rev 37422)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-05-24 14:06:59 UTC (rev 37423)
@@ -355,21 +355,23 @@
         pattern = str(text)
         if len(cmd) > 1:
             # search for module's options
-            if not self._module:
+            if cmd[0] in self._choicesCmd and not self._module:
                 self._module = menuform.GUI().ParseInterface(cmd = cmd)
-            if len(cmd[-1].split('=', 1)) == 1:
-                # new option
-                if cmd[-1][0] == '-':
-                    # -> flags
-                    self.SetChoices(self._module.get_list_flags(), type = 'flag')
-                    pattern = cmd[-1].lstrip('-')
+
+            if self._module:
+                if len(cmd[-1].split('=', 1)) == 1:
+                    # new option
+                    if cmd[-1][0] == '-':
+                        # -> flags
+                        self.SetChoices(self._module.get_list_flags(), type = 'flag')
+                        pattern = cmd[-1].lstrip('-')
+                    else:
+                        # -> options
+                        self.SetChoices(self._module.get_list_params(), type = 'param')
+                        pattern = cmd[-1]
                 else:
-                    # -> options
-                    self.SetChoices(self._module.get_list_params(), type = 'param')
-                    pattern = cmd[-1]
-            else:
-                # value
-                pattern = cmd[-1].split('=', 1)[1]
+                    # value
+                    pattern = cmd[-1].split('=', 1)[1]
         else:
             # search for GRASS modules
             if self._module:



More information about the grass-commit mailing list