[GRASS-SVN] r53887 - in grass/trunk/gui/wxpython: core gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Nov 18 03:28:20 PST 2012
Author: annakrat
Date: 2012-11-18 03:28:19 -0800 (Sun, 18 Nov 2012)
New Revision: 53887
Modified:
grass/trunk/gui/wxpython/core/modulesdata.py
grass/trunk/gui/wxpython/gui_core/prompt.py
Log:
wxGUI/prompt: fix autocompletion
Modified: grass/trunk/gui/wxpython/core/modulesdata.py
===================================================================
--- grass/trunk/gui/wxpython/core/modulesdata.py 2012-11-18 10:45:41 UTC (rev 53886)
+++ grass/trunk/gui/wxpython/core/modulesdata.py 2012-11-18 11:28:19 UTC (rev 53887)
@@ -38,7 +38,7 @@
else:
self.moduleDesc = LayerManagerMenuData().GetModules()
- self.moduleList = self._getListOfModules()
+ self.moduleDict = self.GetDictOfModules()
def GetCommandDesc(self, cmd):
"""!Gets the description for a given module (command).
@@ -67,7 +67,7 @@
"""
items = list()
- mList = self.moduleList
+ mList = self.moduleDict
prefixes = mList.keys()
prefixes.sort()
@@ -82,12 +82,12 @@
return items
- def _getListOfModules(self):
- """!Gets list of modules as a dictionary optimized for autocomplete.
+ def GetDictOfModules(self):
+ """!Gets modules as a dictionary optimized for autocomplete.
\code
- print data._getListOfModules()['r'][0:4]
- print data._getListOfModules()['r.li'][0:4]
+ print data.GetDictOfModules()['r'][0:4]
+ print data.GetDictOfModules()['r.li'][0:4]
r: ['basins.fill', 'bitpattern', 'blend', 'buffer']
r.li: ['cwed', 'dominance', 'edgedensity', 'mpa']
\endcode
@@ -164,9 +164,9 @@
@param data data dict
"""
if data:
- self.moduleList = data
+ self.moduleDict = data
else:
- self.moduleList = self._getListOfModules()
+ self.moduleDict = self.GetDictOfModules()
def test():
@@ -175,7 +175,7 @@
print '%s:' % module, data.GetCommandDesc(module)
print '[0:5]:', data.GetCommandItems()[0:5]
- modules = data._getListOfModules() # pylint: disable=W0212
+ modules = data.GetDictOfModules()
print 'r:', modules['r'][0:4]
print 'r.li:', modules['r.li'][0:4]
Modified: grass/trunk/gui/wxpython/gui_core/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/prompt.py 2012-11-18 10:45:41 UTC (rev 53886)
+++ grass/trunk/gui/wxpython/gui_core/prompt.py 2012-11-18 11:28:19 UTC (rev 53887)
@@ -883,7 +883,7 @@
self.toComplete = self.EntityToComplete()
try:
if self.toComplete['entity'] == 'command':
- self.autoCompList = self.modulesData.GetCommandItems(entry.strip())
+ self.autoCompList = self.modulesData.GetDictOfModules()[entry.strip()]
except (KeyError, TypeError):
return
self.ShowList()
More information about the grass-commit
mailing list