Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/idlelib/AutoCompleteWindow.py

    r2 r391  
    33"""
    44from Tkinter import *
    5 from MultiCall import MC_SHIFT
    6 import AutoComplete
     5from idlelib.MultiCall import MC_SHIFT
     6from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
    77
    88HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
     
    158158        if complete:
    159159            completed = self._complete_string(self.start)
     160            start = self.start
    160161            self._change_start(completed)
    161162            i = self._binary_search(completed)
     
    164165                self.completions[i+1][:len(completed)] != completed):
    165166                # There is exactly one matching completion
    166                 return
     167                return completed == start
    167168        self.userwantswindow = userWantsWin
    168169        self.lasttypedstart = self.start
     
    265266            self.lastkey_was_tab = False
    266267        if (len(keysym) == 1 or keysym in ("underscore", "BackSpace")
    267             or (self.mode==AutoComplete.COMPLETE_FILES and keysym in
     268            or (self.mode == COMPLETE_FILES and keysym in
    268269                ("period", "minus"))) \
    269270           and not (state & ~MC_SHIFT):
     
    293294            return
    294295
    295         elif (self.mode == AutoComplete.COMPLETE_ATTRIBUTES and keysym in
     296        elif (self.mode == COMPLETE_ATTRIBUTES and keysym in
    296297              ("period", "space", "parenleft", "parenright", "bracketleft",
    297298               "bracketright")) or \
    298              (self.mode == AutoComplete.COMPLETE_FILES and keysym in
     299             (self.mode == COMPLETE_FILES and keysym in
    299300              ("slash", "backslash", "quotedbl", "apostrophe")) \
    300301             and not (state & ~MC_SHIFT):
     
    304305            cursel = int(self.listbox.curselection()[0])
    305306            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):
    307308                self._change_start(self.completions[cursel])
    308309            self.hide_window()
     
    350351                return
    351352
    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")):
    356355            # A modifier key, so ignore
    357356            return
Note: See TracChangeset for help on using the changeset viewer.