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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 25 15:24:05 EST 2009


Author: martinl
Date: 2009-12-25 15:24:02 -0500 (Fri, 25 Dec 2009)
New Revision: 40138

Modified:
   grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI/prompt: fix 'ctrl+space' (cont'ed)


Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-12-25 20:18:32 UTC (rev 40137)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-12-25 20:24:02 UTC (rev 40138)
@@ -796,14 +796,15 @@
             elif event.GetKeyCode() == wx.WXK_SPACE and event.ControlDown():
                 # manual autocompletion
                 # map entries without arguments (as in r.info [mapname]) use ctrl-shift
-                cmdtype = self.GetTextLeft().split('.')[0]
-                if cmdtype=='r' or cmdtype=='i':
-                    self.promptType = 'raster'
-                elif cmdtype=='v':
-                    self.promptType = 'vector'
-                elif cmdtype=='r3':
-                    self.promptType = 'raster3d'
+                if not self.cmdDesc:
+                    return
                 
+                try:
+                    param = self.cmdDesc.get_list_params()[0]
+                    self.promptType = self.cmdDesc.get_param(param)['prompt']
+                except IndexError:
+                    return
+            
             if self.promptType and self.promptType in ('raster', 'raster3d', 'vector'):
                 self.autoCompList = self.mapList[self.promptType]
                 self.AutoCompShow(lenEntered = 0, itemList = ' '.join(self.autoCompList))



More information about the grass-commit mailing list