diff options
author | Guido van Rossum <guido@python.org> | 2007-07-20 04:05:57 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-20 04:05:57 +0000 |
commit | c3f7e2926cdc8293e85b6fdca4338a474e4db986 (patch) | |
tree | fbbd3b585f07cbe2bd7143280f461019f86740b5 /Lib/idlelib | |
parent | c3bf9ef67251c82c90a4f7c606084ce324f7111d (diff) | |
download | cpython-c3f7e2926cdc8293e85b6fdca4338a474e4db986.tar.gz |
Merged revisions 56443-56466 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk
................
r56454 | kurt.kaiser | 2007-07-18 22:26:14 -0700 (Wed, 18 Jul 2007) | 2 lines
Make relative imports explicit for py3k
................
r56455 | kurt.kaiser | 2007-07-18 23:12:15 -0700 (Wed, 18 Jul 2007) | 2 lines
Was modifying dict during iteration.
................
r56457 | guido.van.rossum | 2007-07-19 07:33:19 -0700 (Thu, 19 Jul 2007) | 2 lines
Fix failing test.
................
r56466 | guido.van.rossum | 2007-07-19 20:58:16 -0700 (Thu, 19 Jul 2007) | 35 lines
Merged revisions 56413-56465 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r56439 | georg.brandl | 2007-07-17 23:37:55 -0700 (Tue, 17 Jul 2007) | 2 lines
Use "Unix" as platform name, not "UNIX".
........
r56441 | guido.van.rossum | 2007-07-18 10:19:14 -0700 (Wed, 18 Jul 2007) | 3 lines
SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors.
(Slightly tweaked for style and refcounts.)
........
r56444 | kurt.kaiser | 2007-07-18 12:58:42 -0700 (Wed, 18 Jul 2007) | 2 lines
Fix failing unicode test caused by change to ast.c at r56441
........
r56451 | georg.brandl | 2007-07-18 15:36:53 -0700 (Wed, 18 Jul 2007) | 2 lines
Add description for wave.setcomptype() values
........
r56456 | walter.doerwald | 2007-07-19 06:04:38 -0700 (Thu, 19 Jul 2007) | 3 lines
Document that codecs.lookup() returns a CodecInfo object.
(fixes SF bug #1754453).
........
r56463 | facundo.batista | 2007-07-19 16:57:38 -0700 (Thu, 19 Jul 2007) | 6 lines
Added a select.select call in the test server loop to make sure the
socket is ready to be read from before attempting a read (this
prevents an error 10035 on some Windows platforms). [GSoC - Alan
McIntyre]
........
................
Diffstat (limited to 'Lib/idlelib')
37 files changed, 125 insertions, 123 deletions
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py index 7085386621..72f221cae0 100644 --- a/Lib/idlelib/AutoComplete.py +++ b/Lib/idlelib/AutoComplete.py @@ -7,10 +7,9 @@ import os import sys import string -from configHandler import idleConf - -import AutoCompleteWindow -from HyperParser import HyperParser +from .configHandler import idleConf +from . import AutoCompleteWindow +from .HyperParser import HyperParser import __main__ diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py index 56433cd546..20becaa339 100644 --- a/Lib/idlelib/AutoCompleteWindow.py +++ b/Lib/idlelib/AutoCompleteWindow.py @@ -2,8 +2,8 @@ An auto-completion window for IDLE, used by the AutoComplete extension """ from Tkinter import * -from MultiCall import MC_SHIFT -import AutoComplete +from .MultiCall import MC_SHIFT +import idlelib.AutoComplete HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>" HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>") diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py index a3c9fc45f8..26f4497a5a 100644 --- a/Lib/idlelib/Bindings.py +++ b/Lib/idlelib/Bindings.py @@ -9,7 +9,7 @@ windows. """ import sys -from configHandler import idleConf +from .configHandler import idleConf menudefs = [ # underscore prefixes character to underscore @@ -80,7 +80,6 @@ menudefs = [ ]), ] -import sys if sys.platform == 'darwin' and '.app' in sys.executable: # Running as a proper MacOS application bundle. This block restructures # the menus a little to make them conform better to the HIG. diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/CallTips.py index 6f81af4891..235e199f6e 100644 --- a/Lib/idlelib/CallTips.py +++ b/Lib/idlelib/CallTips.py @@ -9,8 +9,8 @@ import re import sys import types -import CallTipWindow -from HyperParser import HyperParser +from . import CallTipWindow +from .HyperParser import HyperParser import __main__ diff --git a/Lib/idlelib/ClassBrowser.py b/Lib/idlelib/ClassBrowser.py index d3f90483d2..edda0edf10 100644 --- a/Lib/idlelib/ClassBrowser.py +++ b/Lib/idlelib/ClassBrowser.py @@ -14,10 +14,10 @@ import os import sys import pyclbr -import PyShell -from WindowList import ListedToplevel -from TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from configHandler import idleConf +from . import PyShell +from .WindowList import ListedToplevel +from .TreeWidget import TreeNode, TreeItem, ScrolledCanvas +from .configHandler import idleConf class ClassBrowser: diff --git a/Lib/idlelib/CodeContext.py b/Lib/idlelib/CodeContext.py index 2037d6fffd..065be0f1d0 100644 --- a/Lib/idlelib/CodeContext.py +++ b/Lib/idlelib/CodeContext.py @@ -11,9 +11,9 @@ not open blocks are not shown in the context hints pane. """ import Tkinter from Tkconstants import TOP, LEFT, X, W, SUNKEN -from configHandler import idleConf import re from sys import maxint as INFINITY +from .configHandler import idleConf BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for", "if", "try", "while", "with"]) diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py index 5328d41196..2b1c870ec3 100644 --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -3,8 +3,8 @@ import re import keyword import __builtin__ from Tkinter import * -from Delegator import Delegator -from configHandler import idleConf +from .Delegator import Delegator +from .configHandler import idleConf DEBUG = False @@ -248,7 +248,7 @@ class ColorDelegator(Delegator): self.tag_remove(tag, "1.0", "end") def main(): - from Percolator import Percolator + from .Percolator import Percolator root = Tk() root.wm_protocol("WM_DELETE_WINDOW", root.quit) text = Text(background="white") diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py index 3dbe23d63f..df51c45327 100644 --- a/Lib/idlelib/Debugger.py +++ b/Lib/idlelib/Debugger.py @@ -2,9 +2,9 @@ import os import bdb import types from Tkinter import * -from WindowList import ListedToplevel -from ScrolledList import ScrolledList -import macosxSupport +from .WindowList import ListedToplevel +from .ScrolledList import ScrolledList +from . import macosxSupport class Idb(bdb.Bdb): diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 7e75a6cb04..501ae0f412 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -6,18 +6,19 @@ from itertools import count from Tkinter import * import tkSimpleDialog import tkMessageBox -from MultiCall import MultiCallCreator - +import traceback import webbrowser -import idlever -import WindowList -import SearchDialog -import GrepDialog -import ReplaceDialog -import PyParse -from configHandler import idleConf -import aboutDialog, textView, configDialog -import macosxSupport + +from .MultiCall import MultiCallCreator +from . import idlever +from . import WindowList +from . import SearchDialog +from . import GrepDialog +from . import ReplaceDialog +from . import PyParse +from .configHandler import idleConf +from . import aboutDialog, textView, configDialog +from . import macosxSupport # The default tab setting for a Text widget, in average-width characters. TK_TABWIDTH_DEFAULT = 8 @@ -40,13 +41,13 @@ def _find_module(fullname, path=None): return file, filename, descr class EditorWindow(object): - from Percolator import Percolator - from ColorDelegator import ColorDelegator - from UndoDelegator import UndoDelegator - from IOBinding import IOBinding, filesystemencoding, encoding - import Bindings + from .Percolator import Percolator + from .ColorDelegator import ColorDelegator + from .UndoDelegator import UndoDelegator + from .IOBinding import IOBinding, filesystemencoding, encoding + from . import Bindings from Tkinter import Toplevel - from MultiStatusBar import MultiStatusBar + from .MultiStatusBar import MultiStatusBar help_url = None @@ -530,11 +531,11 @@ class EditorWindow(object): return None head, tail = os.path.split(filename) base, ext = os.path.splitext(tail) - import ClassBrowser + from . import ClassBrowser ClassBrowser.ClassBrowser(self.flist, base, [head]) def open_path_browser(self, event=None): - import PathBrowser + from . import PathBrowser PathBrowser.PathBrowser(self.flist) def gotoline(self, lineno): @@ -860,7 +861,6 @@ class EditorWindow(object): self.load_extension(name) except: print("Failed to load extension", repr(name)) - import traceback traceback.print_exc() def get_standard_extension_names(self): @@ -871,7 +871,7 @@ class EditorWindow(object): mod = __import__(name, globals(), locals(), []) except ImportError: print("\nFailed to import extension: ", name) - return + raise cls = getattr(mod, name) keydefs = idleConf.GetExtensionBindings(name) if hasattr(cls, "menudefs"): diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py index 860dbaefda..7e1d919413 100644 --- a/Lib/idlelib/FileList.py +++ b/Lib/idlelib/FileList.py @@ -5,7 +5,7 @@ import tkMessageBox class FileList: - from EditorWindow import EditorWindow # class variable, may be overridden + from .EditorWindow import EditorWindow # class variable, may be overridden # e.g. by PyShellFileList def __init__(self, root): @@ -106,7 +106,7 @@ class FileList: def _test(): - from EditorWindow import fixwordbreaks + from .EditorWindow import fixwordbreaks import sys root = Tk() fixwordbreaks(root) diff --git a/Lib/idlelib/FormatParagraph.py b/Lib/idlelib/FormatParagraph.py index ed9f28d125..57868f1276 100644 --- a/Lib/idlelib/FormatParagraph.py +++ b/Lib/idlelib/FormatParagraph.py @@ -15,7 +15,7 @@ # * Fancy comments, like this bulleted list, arent handled :-) import re -from configHandler import idleConf +from .configHandler import idleConf class FormatParagraph: diff --git a/Lib/idlelib/GrepDialog.py b/Lib/idlelib/GrepDialog.py index c96fada305..db3220adaa 100644 --- a/Lib/idlelib/GrepDialog.py +++ b/Lib/idlelib/GrepDialog.py @@ -63,7 +63,7 @@ class GrepDialog(SearchDialogBase): if not path: self.top.bell() return - from OutputWindow import OutputWindow + from .OutputWindow import OutputWindow save = sys.stdout try: sys.stdout = OutputWindow(self.flist) diff --git a/Lib/idlelib/HyperParser.py b/Lib/idlelib/HyperParser.py index 31f46b16ac..409e3c4989 100644 --- a/Lib/idlelib/HyperParser.py +++ b/Lib/idlelib/HyperParser.py @@ -10,7 +10,7 @@ structure of code, used by extensions to help the user. import string import keyword -import PyParse +from . import PyParse class HyperParser: diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index 006e94b187..d749788fb2 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -14,9 +14,9 @@ import tkFileDialog import tkMessageBox import re from Tkinter import * -from SimpleDialog import SimpleDialog +from .SimpleDialog import SimpleDialog -from configHandler import idleConf +from .configHandler import idleConf try: from codecs import BOM_UTF8 diff --git a/Lib/idlelib/IdleHistory.py b/Lib/idlelib/IdleHistory.py index 960242f781..8766ade16b 100644 --- a/Lib/idlelib/IdleHistory.py +++ b/Lib/idlelib/IdleHistory.py @@ -1,4 +1,4 @@ -from configHandler import idleConf +from .configHandler import idleConf class History: diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/ObjectBrowser.py index 0976d91202..ad31c2337d 100644 --- a/Lib/idlelib/ObjectBrowser.py +++ b/Lib/idlelib/ObjectBrowser.py @@ -9,7 +9,7 @@ # XXX TO DO: # - for classes/modules, add "open source" to object browser -from TreeWidget import TreeItem, TreeNode, ScrolledCanvas +from .TreeWidget import TreeItem, TreeNode, ScrolledCanvas from repr import Repr diff --git a/Lib/idlelib/OutputWindow.py b/Lib/idlelib/OutputWindow.py index ae795e17fb..7991e1836c 100644 --- a/Lib/idlelib/OutputWindow.py +++ b/Lib/idlelib/OutputWindow.py @@ -1,8 +1,8 @@ from Tkinter import * -from EditorWindow import EditorWindow +from .EditorWindow import EditorWindow import re import tkMessageBox -import IOBinding +from . import IOBinding class OutputWindow(EditorWindow): diff --git a/Lib/idlelib/ParenMatch.py b/Lib/idlelib/ParenMatch.py index 250ae8b702..6f56827a90 100644 --- a/Lib/idlelib/ParenMatch.py +++ b/Lib/idlelib/ParenMatch.py @@ -5,8 +5,8 @@ paren. Paren here is used generically; the matching applies to parentheses, square brackets, and curly braces. """ -from HyperParser import HyperParser -from configHandler import idleConf +from .HyperParser import HyperParser +from .configHandler import idleConf _openers = {')':'(',']':'[','}':'{'} CHECK_DELAY = 100 # miliseconds diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/PathBrowser.py index 8c73587904..65efb4875e 100644 --- a/Lib/idlelib/PathBrowser.py +++ b/Lib/idlelib/PathBrowser.py @@ -2,8 +2,8 @@ import os import sys import imp -from TreeWidget import TreeItem -from ClassBrowser import ClassBrowser, ModuleBrowserTreeItem +from .TreeWidget import TreeItem +from .ClassBrowser import ClassBrowser, ModuleBrowserTreeItem class PathBrowser(ClassBrowser): @@ -86,7 +86,7 @@ class DirBrowserTreeItem(TreeItem): return sorted def main(): - import PyShell + from . import PyShell PathBrowser(PyShell.flist) if sys.stdin is sys.__stdin__: mainloop() diff --git a/Lib/idlelib/Percolator.py b/Lib/idlelib/Percolator.py index a0b1303792..22b6288afc 100644 --- a/Lib/idlelib/Percolator.py +++ b/Lib/idlelib/Percolator.py @@ -1,5 +1,5 @@ -from WidgetRedirector import WidgetRedirector -from Delegator import Delegator +from .WidgetRedirector import WidgetRedirector +from .Delegator import Delegator class Percolator: diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index f11e609d9c..567994e7b1 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -11,7 +11,6 @@ import time import threading import traceback import types -import macosxSupport import linecache from code import InteractiveInterpreter @@ -24,17 +23,17 @@ except ImportError: sys.exit(1) import tkMessageBox -from EditorWindow import EditorWindow, fixwordbreaks -from FileList import FileList -from ColorDelegator import ColorDelegator -from UndoDelegator import UndoDelegator -from OutputWindow import OutputWindow -from configHandler import idleConf -import idlever - -import rpc -import Debugger -import RemoteDebugger +from .EditorWindow import EditorWindow, fixwordbreaks +from .FileList import FileList +from .ColorDelegator import ColorDelegator +from .UndoDelegator import UndoDelegator +from .OutputWindow import OutputWindow +from .configHandler import idleConf +from . import idlever +from . import rpc +from . import Debugger +from . import RemoteDebugger +from . import macosxSupport IDENTCHARS = string.ascii_letters + string.digits + "_" LOCALHOST = '127.0.0.1' @@ -542,13 +541,13 @@ class ModifiedInterpreter(InteractiveInterpreter): return def remote_stack_viewer(self): - import RemoteObjectBrowser + from . import RemoteObjectBrowser oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {}) if oid is None: self.tkconsole.root.bell() return item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid) - from TreeWidget import ScrolledCanvas, TreeNode + from .TreeWidget import ScrolledCanvas, TreeNode top = Toplevel(self.tkconsole.root) theme = idleConf.GetOption('main','Theme','name') background = idleConf.GetHighlight(theme, 'normal')['background'] @@ -588,7 +587,7 @@ class ModifiedInterpreter(InteractiveInterpreter): self.save_warnings_filters = warnings.filters[:] warnings.filterwarnings(action="error", category=SyntaxWarning) if isinstance(source, types.UnicodeType): - import IOBinding + from . import IOBinding try: source = source.encode(IOBinding.encoding) except UnicodeError: @@ -677,7 +676,7 @@ class ModifiedInterpreter(InteractiveInterpreter): def checklinecache(self): c = linecache.cache - for key in c.keys(): + for key in list(c.keys()): if key[:1] + key[-1:] != "<>": del c[key] @@ -798,7 +797,7 @@ class PyShell(OutputWindow): # New classes - from IdleHistory import History + from .IdleHistory import History def __init__(self, flist=None): if use_subprocess: @@ -837,7 +836,7 @@ class PyShell(OutputWindow): self.save_stdout = sys.stdout self.save_stderr = sys.stderr self.save_stdin = sys.stdin - import IOBinding + from . import IOBinding self.stdout = PseudoFile(self, "stdout", IOBinding.encoding) self.stderr = PseudoFile(self, "stderr", IOBinding.encoding) self.console = PseudoFile(self, "console", IOBinding.encoding) @@ -1007,7 +1006,7 @@ class PyShell(OutputWindow): if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C line = "\n" if isinstance(line, str): - import IOBinding + from . import IOBinding try: line = line.encode(IOBinding.encoding) except UnicodeError: @@ -1195,7 +1194,7 @@ class PyShell(OutputWindow): "(sys.last_traceback is not defined)", master=self.text) return - from StackViewer import StackBrowser + from .StackViewer import StackBrowser sv = StackBrowser(self.root, self.flist) def view_restart_mark(self, event=None): diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/RemoteDebugger.py index 0422cce335..b2d5921950 100644 --- a/Lib/idlelib/RemoteDebugger.py +++ b/Lib/idlelib/RemoteDebugger.py @@ -22,8 +22,8 @@ barrier, in particular frame and traceback objects. import sys import types -import rpc -import Debugger +from . import rpc +from . import Debugger debugging = 0 diff --git a/Lib/idlelib/RemoteObjectBrowser.py b/Lib/idlelib/RemoteObjectBrowser.py index 6ba3391372..bcb9a2e0e4 100644 --- a/Lib/idlelib/RemoteObjectBrowser.py +++ b/Lib/idlelib/RemoteObjectBrowser.py @@ -1,4 +1,4 @@ -import rpc +from . import rpc def remote_object_tree_item(item): wrapper = WrappedObjectTreeItem(item) diff --git a/Lib/idlelib/ReplaceDialog.py b/Lib/idlelib/ReplaceDialog.py index c8eb1c8c45..df7bed8bc6 100644 --- a/Lib/idlelib/ReplaceDialog.py +++ b/Lib/idlelib/ReplaceDialog.py @@ -1,6 +1,7 @@ from Tkinter import * -import SearchEngine -from SearchDialogBase import SearchDialogBase + +from . import SearchEngine +from .SearchDialogBase import SearchDialogBase def replace(text): root = text._root() diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py index a83f715ab3..c8ae60bffa 100644 --- a/Lib/idlelib/ScriptBinding.py +++ b/Lib/idlelib/ScriptBinding.py @@ -23,9 +23,9 @@ import string import tabnanny import tokenize import tkMessageBox -import PyShell +from . import PyShell -from configHandler import idleConf +from .configHandler import idleConf IDENTCHARS = string.ascii_letters + string.digits + "_" diff --git a/Lib/idlelib/SearchDialog.py b/Lib/idlelib/SearchDialog.py index d7124d67ff..87c34c1774 100644 --- a/Lib/idlelib/SearchDialog.py +++ b/Lib/idlelib/SearchDialog.py @@ -1,7 +1,7 @@ from Tkinter import * -import SearchEngine -from SearchDialogBase import SearchDialogBase +from . import SearchEngine +from .SearchDialogBase import SearchDialogBase def _setup(text): root = text._root() diff --git a/Lib/idlelib/StackViewer.py b/Lib/idlelib/StackViewer.py index 79324ae3e9..8a1cace1a1 100644 --- a/Lib/idlelib/StackViewer.py +++ b/Lib/idlelib/StackViewer.py @@ -2,8 +2,8 @@ import os import sys import linecache -from TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from ObjectBrowser import ObjectTreeItem, make_objecttreeitem +from .TreeWidget import TreeNode, TreeItem, ScrolledCanvas +from .ObjectBrowser import ObjectTreeItem, make_objecttreeitem def StackBrowser(root, flist=None, tb=None, top=None): if top is None: diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py index 1d777dfb49..8210117e5b 100644 --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/TreeWidget.py @@ -19,8 +19,8 @@ import sys from Tkinter import * import imp -import ZoomHeight -from configHandler import idleConf +from . import ZoomHeight +from .configHandler import idleConf ICONDIR = "Icons" @@ -453,7 +453,7 @@ class ScrolledCanvas: # Testing functions def test(): - import PyShell + from . import PyShell root = Toplevel(PyShell.root) root.configure(bd=0, bg="yellow") root.focus_set() diff --git a/Lib/idlelib/UndoDelegator.py b/Lib/idlelib/UndoDelegator.py index 0f95b3bddc..2b836a8bac 100644 --- a/Lib/idlelib/UndoDelegator.py +++ b/Lib/idlelib/UndoDelegator.py @@ -1,7 +1,8 @@ import sys import string from Tkinter import * -from Delegator import Delegator + +from .Delegator import Delegator #$ event <<redo>> #$ win <Control-y> @@ -337,7 +338,7 @@ class CommandSequence(Command): return self.depth def main(): - from Percolator import Percolator + from .Percolator import Percolator root = Tk() root.wm_protocol("WM_DELETE_WINDOW", root.quit) text = Text() diff --git a/Lib/idlelib/ZoomHeight.py b/Lib/idlelib/ZoomHeight.py index 83ca3a6970..5627a0d5f4 100644 --- a/Lib/idlelib/ZoomHeight.py +++ b/Lib/idlelib/ZoomHeight.py @@ -2,7 +2,8 @@ import re import sys -import macosxSupport + +from . import macosxSupport class ZoomHeight: diff --git a/Lib/idlelib/aboutDialog.py b/Lib/idlelib/aboutDialog.py index afdafd2844..3e6707896d 100644 --- a/Lib/idlelib/aboutDialog.py +++ b/Lib/idlelib/aboutDialog.py @@ -4,8 +4,9 @@ from Tkinter import * import os -import textView -import idlever + +from . import textView +from . import idlever class AboutDialog(Toplevel): """Modal about dialog for idle @@ -157,7 +158,7 @@ if __name__ == '__main__': # test the dialog root = Tk() def run(): - import aboutDialog + from . import aboutDialog aboutDialog.AboutDialog(root, 'About') Button(root, text='Dialog', command=run).pack() root.mainloop() diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index eadb69dcd1..b3e7b3ea68 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -13,12 +13,12 @@ from Tkinter import * import tkMessageBox, tkColorChooser, tkFont import copy -from configHandler import idleConf -from dynOptionMenuWidget import DynOptionMenu -from tabpage import TabPageSet -from keybindingDialog import GetKeysDialog -from configSectionNameDialog import GetCfgSectionNameDialog -from configHelpSourceEdit import GetHelpSourceDialog +from .configHandler import idleConf +from .dynOptionMenuWidget import DynOptionMenu +from .tabpage import TabPageSet +from .keybindingDialog import GetKeysDialog +from .configSectionNameDialog import GetCfgSectionNameDialog +from .configHelpSourceEdit import GetHelpSourceDialog class ConfigDialog(Toplevel): diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 963cf95178..98d6be7645 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -19,8 +19,9 @@ configuration problem notification and resolution. """ import os import sys -import macosxSupport -from ConfigParser import ConfigParser, NoOptionError, NoSectionError + +from . import macosxSupport +from .ConfigParser import ConfigParser, NoOptionError, NoSectionError class InvalidConfigType(Exception): pass class InvalidConfigSet(Exception): pass diff --git a/Lib/idlelib/idle.py b/Lib/idlelib/idle.py index 537dd5a9a7..0db5fd426e 100644 --- a/Lib/idlelib/idle.py +++ b/Lib/idlelib/idle.py @@ -3,7 +3,7 @@ try: except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: try: - import PyShell + from . import PyShell except ImportError: raise else: diff --git a/Lib/idlelib/idle.pyw b/Lib/idlelib/idle.pyw index 537dd5a9a7..0db5fd426e 100644 --- a/Lib/idlelib/idle.pyw +++ b/Lib/idlelib/idle.pyw @@ -3,7 +3,7 @@ try: except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: try: - import PyShell + from . import PyShell except ImportError: raise else: diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py index 222abfce75..14c5bd89db 100644 --- a/Lib/idlelib/macosxSupport.py +++ b/Lib/idlelib/macosxSupport.py @@ -47,10 +47,10 @@ def overrideRootMenu(root, flist): # Due to a (mis-)feature of TkAqua the user will also see an empty Help # menu. from Tkinter import Menu, Text, Text - from EditorWindow import prepstr, get_accelerator - import Bindings - import WindowList - from MultiCall import MultiCallCreator + from .EditorWindow import prepstr, get_accelerator + from . import Bindings + from . import WindowList + from .MultiCall import MultiCallCreator menubar = Menu(root) root.configure(menu=menubar) @@ -73,11 +73,11 @@ def overrideRootMenu(root, flist): menubar.add_cascade(label='IDLE', menu=menu) def about_dialog(event=None): - import aboutDialog + from . import aboutDialog aboutDialog.AboutDialog(root, 'About IDLE') def config_dialog(event=None): - import configDialog + from . import configDialog configDialog.ConfigDialog(root, 'Settings') diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 8a0b926575..614875a86a 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -8,13 +8,13 @@ import thread import threading import Queue -import CallTips -import AutoComplete +from . import CallTips +from . import AutoComplete -import RemoteDebugger -import RemoteObjectBrowser -import StackViewer -import rpc +from . import RemoteDebugger +from . import RemoteObjectBrowser +from . import StackViewer +from . import rpc import __main__ @@ -243,7 +243,7 @@ class MyHandler(rpc.RPCHandler): sys.stdin = self.console = self.get_remote_proxy("stdin") sys.stdout = self.get_remote_proxy("stdout") sys.stderr = self.get_remote_proxy("stderr") - import IOBinding + from . import IOBinding sys.stdin.encoding = sys.stdout.encoding = \ sys.stderr.encoding = IOBinding.encoding self.interp = self.get_remote_proxy("interp") |