Browse Source

wxGUI: fix for python 2.4 cont'ed
(merge https://trac.osgeo.org/grass/changeset/45962 from relbr64)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@45963 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 14 years ago
parent
commit
2134be9405
1 changed files with 6 additions and 5 deletions
  1. 6 5
      gui/wxpython/gui_modules/prompt.py

+ 6 - 5
gui/wxpython/gui_modules/prompt.py

@@ -850,8 +850,7 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
             toComplete['entity'] = 'command'
             toComplete['cmd'] = cmd
             return toComplete
-                
-            
+    
     def GetWordLeft(self, withDelimiter = False, ignoredDelimiter = None):
         """!Get word left from current cursor position. The beginning
         of the word is given by space or chars: .,-= 
@@ -866,11 +865,13 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
             ignoredDelimiter = ''
         
         for char in set(' .,-=') - set(ignoredDelimiter):
-            delimiter = '' if not withDelimiter else char
+            if not withDelimiter:
+                delimiter = ''
+            else:
+                delimiter = char
             parts.append(delimiter + textLeft.rpartition(char)[2])
         return min(parts, key=lambda x: len(x))
-        
-        
+         
     def ShowList(self):
         """!Show sorted auto-completion list if it is not empty"""
         if len(self.autoCompList) > 0: