[GRASS-SVN] r40284 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 6 08:54:55 EST 2010
Author: martinl
Date: 2010-01-06 08:54:54 -0500 (Wed, 06 Jan 2010)
New Revision: 40284
Modified:
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: fix search by keywords
Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-01-06 13:46:39 UTC (rev 40283)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-01-06 13:54:54 UTC (rev 40284)
@@ -565,7 +565,7 @@
if text in data['desc']:
found = True
else: # -> keywords
- if self.__checkKey(text, data['keywords']):
+ if self.cmd_prompt.CheckKey(text, data['keywords']):
found = True
if found:
Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py 2010-01-06 13:46:39 UTC (rev 40283)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py 2010-01-06 13:54:54 UTC (rev 40284)
@@ -494,7 +494,34 @@
self.cmdDesc = None
self.cmdbuffer = self._readHistory()
self.cmdindex = len(self.cmdbuffer)
+
+ def CheckKey(self, text, keywords):
+ """!Check if text is in keywords (unused)"""
+ found = 0
+ keys = text.split(',')
+ if len(keys) > 1: # -> multiple keys
+ for k in keys[:-1]:
+ k = k.strip()
+ for key in keywords:
+ if k == key: # full match
+ found += 1
+ break
+ k = keys[-1].strip()
+ for key in keywords:
+ if k in key: # partial match
+ found +=1
+ break
+ else:
+ for key in keywords:
+ if text in key: # partial match
+ found +=1
+ break
+ if found == len(keys):
+ return True
+
+ return False
+
def _readHistory(self):
"""!Get list of commands from history file"""
hist = list()
@@ -610,33 +637,6 @@
self.Bind(wx.EVT_TEXT_ENTER, self.OnRunCmd)
self.Bind(wx.EVT_TEXT, self.OnUpdateStatusBar)
- def __checkKey(self, text, keywords):
- """!Check if text is in keywords (unused)"""
- found = 0
- keys = text.split(',')
- if len(keys) > 1: # -> multiple keys
- for k in keys[:-1]:
- k = k.strip()
- for key in keywords:
- if k == key: # full match
- found += 1
- break
- k = keys[-1].strip()
- for key in keywords:
- if k in key: # partial match
- found +=1
- break
- else:
- for key in keywords:
- if text in key: # partial match
- found +=1
- break
-
- if found == len(keys):
- return True
-
- return False
-
def OnCmdErase(self, event):
"""!Erase command prompt"""
self.input.SetValue('')
More information about the grass-commit
mailing list