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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 12 04:07:57 EDT 2010


Author: martinl
Date: 2010-05-12 04:07:52 -0400 (Wed, 12 May 2010)
New Revision: 42231

Modified:
   grass/trunk/gui/wxpython/gui_modules/ghelp.py
   grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: fix search module engine


Modified: grass/trunk/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/ghelp.py	2010-05-12 06:14:49 UTC (rev 42230)
+++ grass/trunk/gui/wxpython/gui_modules/ghelp.py	2010-05-12 08:07:52 UTC (rev 42231)
@@ -157,12 +157,16 @@
         iFound = 0
         for module, data in self.cmdPrompt.moduleDesc.iteritems():
             found = False
-            if self.searchBy.GetSelection() == 0: # -> description
+            sel = self.searchBy.GetSelection()
+            if sel == 0: # -> description
                 if text in data['desc']:
                     found = True
-            else: # -> keywords
+            elif sel == 1: # keywords
                 if self.cmdPrompt.CheckKey(text, data['keywords']):
                     found = True
+            else: # command
+                if text in module:
+                    found = True
             
             if found:
                 iFound += 1
@@ -176,9 +180,9 @@
                 modules[group].append(name)
         
         self.cmdPrompt.SetFilter(modules)
+        self.searchChoice.SetItems(self.cmdPrompt.GetCommandItems())
         if self.showTip:
             self.searchTip.SetLabel(_("%d modules found") % iFound)
-        self.searchChoice.SetItems(self.cmdPrompt.GetCommandItems())
         
         event.Skip()
         

Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py	2010-05-12 06:14:49 UTC (rev 42230)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py	2010-05-12 08:07:52 UTC (rev 42231)
@@ -556,7 +556,7 @@
         """!Get list of available commands"""
         items = list()
         
-        if self.autoCompFilter:
+        if self.autoCompFilter is not None:
             mList = self.autoCompFilter
         else:
             mList = self.moduleList



More information about the grass-commit mailing list