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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 25 15:18:33 EST 2009


Author: martinl
Date: 2009-12-25 15:18:32 -0500 (Fri, 25 Dec 2009)
New Revision: 40137

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


Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-12-24 22:00:51 UTC (rev 40136)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py	2009-12-25 20:18:32 UTC (rev 40137)
@@ -717,12 +717,6 @@
         @todo event.ControlDown() for manual autocomplete
         """
         # keycodes used: "." = 46, "=" = 61, "," = 44 
-        line = ''
-        entry = ''
-        usage = ''
-        cmdtype = ''
-        cmdname = ''
-        cmd = ''
         
         if event.GetKeyCode() == 46 and not event.ShiftDown():
             # GRASS command autocomplete when '.' is pressed after 'r', 'v', 'i', 'g', 'db', or 'd'
@@ -802,16 +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
-                
-                maplist = []
+                cmdtype = self.GetTextLeft().split('.')[0]
                 if cmdtype=='r' or cmdtype=='i':
-                    self.maptype = 'rast'
+                    self.promptType = 'raster'
                 elif cmdtype=='v':
-                    self.maptype = 'vect'
+                    self.promptType = 'vector'
                 elif cmdtype=='r3':
-                    self.maptype = 'rast3d'
-                    
-            if self.promptType and self.promptType in ('raster', 'vector'):
+                    self.promptType = 'raster3d'
+                
+            if self.promptType and self.promptType in ('raster', 'raster3d', 'vector'):
                 self.autoCompList = self.mapList[self.promptType]
                 self.AutoCompShow(lenEntered = 0, itemList = ' '.join(self.autoCompList))
             
@@ -886,10 +879,9 @@
         
     def GetTextLeft(self):
         """!Returns all text left of the caret"""
-        entry = ''
         pos = self.GetCurrentPos()
         self.HomeExtend()
-        entry = self.GetSelectedText().strip()
+        entry = self.GetSelectedText()
         self.SetCurrentPos(pos)
         
         return entry



More information about the grass-commit mailing list