[Python-3000-checkins] r56883 - python/branches/py3k/Lib/idlelib/AutoComplete.py python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py

kurt.kaiser python-3000-checkins at python.org
Fri Aug 10 04:45:07 CEST 2007


Author: kurt.kaiser
Date: Fri Aug 10 04:45:06 2007
New Revision: 56883

Modified:
   python/branches/py3k/Lib/idlelib/AutoComplete.py
   python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py
Log:
Fix circular import issue


Modified: python/branches/py3k/Lib/idlelib/AutoComplete.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/AutoComplete.py	(original)
+++ python/branches/py3k/Lib/idlelib/AutoComplete.py	Fri Aug 10 04:45:06 2007
@@ -8,10 +8,6 @@
 import string
 
 from .configHandler import idleConf
-from . import AutoCompleteWindow
-from .HyperParser import HyperParser
-
-import __main__
 
 # This string includes all chars that may be in a file name (without a path
 # separator)
@@ -22,6 +18,11 @@
 # These constants represent the two different types of completions
 COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1)
 
+from . import AutoCompleteWindow
+from .HyperParser import HyperParser
+
+import __main__
+
 class AutoComplete:
 
     menudefs = [

Modified: python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py	Fri Aug 10 04:45:06 2007
@@ -3,7 +3,7 @@
 """
 from Tkinter import *
 from .MultiCall import MC_SHIFT
-import idlelib.AutoComplete
+from .AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
 
 HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
 HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>")
@@ -259,7 +259,7 @@
         if keysym != "Tab":
             self.lastkey_was_tab = False
         if (len(keysym) == 1 or keysym in ("underscore", "BackSpace")
-            or (self.mode==AutoComplete.COMPLETE_FILES and keysym in
+            or (self.mode == COMPLETE_FILES and keysym in
                 ("period", "minus"))) \
            and not (state & ~MC_SHIFT):
             # Normal editing of text
@@ -298,10 +298,10 @@
                 self.hide_window()
                 return
 
-        elif (self.mode == AutoComplete.COMPLETE_ATTRIBUTES and keysym in
+        elif (self.mode == COMPLETE_ATTRIBUTES and keysym in
               ("period", "space", "parenleft", "parenright", "bracketleft",
                "bracketright")) or \
-             (self.mode == AutoComplete.COMPLETE_FILES and keysym in
+             (self.mode == COMPLETE_FILES and keysym in
               ("slash", "backslash", "quotedbl", "apostrophe")) \
              and not (state & ~MC_SHIFT):
             # If start is a prefix of the selection, but is not '' when
@@ -309,7 +309,7 @@
             # selected completion. Anyway, close the list.
             cursel = int(self.listbox.curselection()[0])
             if self.completions[cursel][:len(self.start)] == self.start \
-               and (self.mode==AutoComplete.COMPLETE_ATTRIBUTES or self.start):
+               and (self.mode == COMPLETE_ATTRIBUTES or self.start):
                 self._change_start(self.completions[cursel])
             self.hide_window()
             return


More information about the Python-3000-checkins mailing list