[Python-checkins] r62549 - in python/trunk/Lib/idlelib: AutoComplete.py NEWS.txt

kurt.kaiser python-checkins at python.org
Sun Apr 27 23:52:20 CEST 2008


Author: kurt.kaiser
Date: Sun Apr 27 23:52:19 2008
New Revision: 62549

Log:
Autocompletion of filenames now support alternate separators, e.g. the
'/' char on Windows.  Patch 2061 Tal Einat.



Modified:
   python/trunk/Lib/idlelib/AutoComplete.py
   python/trunk/Lib/idlelib/NEWS.txt

Modified: python/trunk/Lib/idlelib/AutoComplete.py
==============================================================================
--- python/trunk/Lib/idlelib/AutoComplete.py	(original)
+++ python/trunk/Lib/idlelib/AutoComplete.py	Sun Apr 27 23:52:19 2008
@@ -23,6 +23,10 @@
 # These constants represent the two different types of completions
 COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1)
 
+SEPS = os.sep
+if os.altsep:  # e.g. '/' on Windows...
+    SEPS += os.altsep
+
 class AutoComplete:
 
     menudefs = [
@@ -70,7 +74,7 @@
         if lastchar == ".":
             self._open_completions_later(False, False, False,
                                          COMPLETE_ATTRIBUTES)
-        elif lastchar == os.sep:
+        elif lastchar in SEPS:
             self._open_completions_later(False, False, False,
                                          COMPLETE_FILES)
 
@@ -126,7 +130,7 @@
                 i -= 1
             comp_start = curline[i:j]
             j = i
-            while i and curline[i-1] in FILENAME_CHARS+os.sep:
+            while i and curline[i-1] in FILENAME_CHARS + SEPS:
                 i -= 1
             comp_what = curline[i:j]
         elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES):

Modified: python/trunk/Lib/idlelib/NEWS.txt
==============================================================================
--- python/trunk/Lib/idlelib/NEWS.txt	(original)
+++ python/trunk/Lib/idlelib/NEWS.txt	Sun Apr 27 23:52:19 2008
@@ -9,7 +9,10 @@
 - Home / Control-A toggles between left margin and end of leading white
   space.  Patch 1196903 Jeff Shute.
 
-- Improved AutoCompleteWindow logic.  Patch 2062 Tal Einat.  
+- Improved AutoCompleteWindow logic.  Patch 2062 Tal Einat.
+
+- Autocompletion of filenames now support alternate separators, e.g. the
+  '/' char on Windows.  Patch 2061 Tal Einat.
 
 What's New in IDLE 2.6a1?
 =========================


More information about the Python-checkins mailing list