summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2008-04-27 21:52:19 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2008-04-27 21:52:19 (GMT)
commit83101909cb8c4d0f9166c277266c0aef6389da96 (patch)
tree92e2ea196a87d0f4cebcbb9e768349bac7a02052 /Lib
parent9c5c0af804fa8dd6578569616d31847b878a2a66 (diff)
downloadcpython-83101909cb8c4d0f9166c277266c0aef6389da96.zip
cpython-83101909cb8c4d0f9166c277266c0aef6389da96.tar.gz
cpython-83101909cb8c4d0f9166c277266c0aef6389da96.tar.bz2
Autocompletion of filenames now support alternate separators, e.g. the
'/' char on Windows. Patch 2061 Tal Einat.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/AutoComplete.py8
-rw-r--r--Lib/idlelib/NEWS.txt5
2 files changed, 10 insertions, 3 deletions
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py
index bed2b8c..1c74d2e 100644
--- a/Lib/idlelib/AutoComplete.py
+++ b/Lib/idlelib/AutoComplete.py
@@ -23,6 +23,10 @@ ID_CHARS = string.ascii_letters + string.digits + "_"
# 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 @@ class AutoComplete:
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 @@ class AutoComplete:
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):
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index c574d00..0b6fa61 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -9,7 +9,10 @@ What's New in IDLE 2.6a3?
- 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?
=========================