Changeset 391 for python/trunk/Lib/idlelib/AutoCompleteWindow.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/idlelib/AutoCompleteWindow.py
r2 r391 3 3 """ 4 4 from Tkinter import * 5 from MultiCall import MC_SHIFT6 import AutoComplete 5 from idlelib.MultiCall import MC_SHIFT 6 from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES 7 7 8 8 HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>" … … 158 158 if complete: 159 159 completed = self._complete_string(self.start) 160 start = self.start 160 161 self._change_start(completed) 161 162 i = self._binary_search(completed) … … 164 165 self.completions[i+1][:len(completed)] != completed): 165 166 # There is exactly one matching completion 166 return 167 return completed == start 167 168 self.userwantswindow = userWantsWin 168 169 self.lasttypedstart = self.start … … 265 266 self.lastkey_was_tab = False 266 267 if (len(keysym) == 1 or keysym in ("underscore", "BackSpace") 267 or (self.mode ==AutoComplete.COMPLETE_FILES and keysym in268 or (self.mode == COMPLETE_FILES and keysym in 268 269 ("period", "minus"))) \ 269 270 and not (state & ~MC_SHIFT): … … 293 294 return 294 295 295 elif (self.mode == AutoComplete.COMPLETE_ATTRIBUTES and keysym in296 elif (self.mode == COMPLETE_ATTRIBUTES and keysym in 296 297 ("period", "space", "parenleft", "parenright", "bracketleft", 297 298 "bracketright")) or \ 298 (self.mode == AutoComplete.COMPLETE_FILES and keysym in299 (self.mode == COMPLETE_FILES and keysym in 299 300 ("slash", "backslash", "quotedbl", "apostrophe")) \ 300 301 and not (state & ~MC_SHIFT): … … 304 305 cursel = int(self.listbox.curselection()[0]) 305 306 if self.completions[cursel][:len(self.start)] == self.start \ 306 and (self.mode ==AutoComplete.COMPLETE_ATTRIBUTES or self.start):307 and (self.mode == COMPLETE_ATTRIBUTES or self.start): 307 308 self._change_start(self.completions[cursel]) 308 309 self.hide_window() … … 350 351 return 351 352 352 elif reduce(lambda x, y: x or y, 353 [keysym.find(s) != -1 for s in ("Shift", "Control", "Alt", 354 "Meta", "Command", "Option") 355 ]): 353 elif any(s in keysym for s in ("Shift", "Control", "Alt", 354 "Meta", "Command", "Option")): 356 355 # A modifier key, so ignore 357 356 return
Note:
See TracChangeset
for help on using the changeset viewer.