mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Switch to absolute imports to support direct execution of modules. Many
IDLE modules have main() or test() functions which are essential for testing. M idlelib/AutoCompleteWindow.py M idlelib/UndoDelegator.py M idlelib/Bindings.py M idlelib/AutoComplete.py M idlelib/configHandler.py M idlelib/HyperParser.py M idlelib/ColorDelegator.py M idlelib/ObjectBrowser.py M idlelib/ZoomHeight.py M idlelib/PyShell.py M idlelib/ParenMatch.py M idlelib/Debugger.py M idlelib/configDialog.py M idlelib/StackViewer.py M idlelib/ReplaceDialog.py M idlelib/ScriptBinding.py M idlelib/GrepDialog.py M idlelib/EditorWindow.py M idlelib/FormatParagraph.py M idlelib/OutputWindow.py M idlelib/aboutDialog.py M idlelib/IdleHistory.py M idlelib/PathBrowser.py M idlelib/ClassBrowser.py M idlelib/CallTips.py M idlelib/FileList.py M idlelib/idle.py M idlelib/CodeContext.py M idlelib/SearchDialog.py M idlelib/RemoteObjectBrowser.py M idlelib/RemoteDebugger.py M idlelib/TreeWidget.py M idlelib/run.py M idlelib/Percolator.py M idlelib/macosxSupport.py
This commit is contained in:
parent
86d8b3497f
commit
2d7f6a079d
35 changed files with 120 additions and 119 deletions
|
@ -7,7 +7,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
# This string includes all chars that may be in a file name (without a path
|
# This string includes all chars that may be in a file name (without a path
|
||||||
# separator)
|
# separator)
|
||||||
|
@ -18,8 +18,8 @@ ID_CHARS = string.ascii_letters + string.digits + "_"
|
||||||
# These constants represent the two different types of completions
|
# These constants represent the two different types of completions
|
||||||
COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1)
|
COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1)
|
||||||
|
|
||||||
from . import AutoCompleteWindow
|
from idlelib import AutoCompleteWindow
|
||||||
from .HyperParser import HyperParser
|
from idlelib.HyperParser import HyperParser
|
||||||
|
|
||||||
import __main__
|
import __main__
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
An auto-completion window for IDLE, used by the AutoComplete extension
|
An auto-completion window for IDLE, used by the AutoComplete extension
|
||||||
"""
|
"""
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from .MultiCall import MC_SHIFT
|
from idlelib.MultiCall import MC_SHIFT
|
||||||
from .AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
|
from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
|
||||||
|
|
||||||
HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
|
HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
|
||||||
HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>")
|
HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>")
|
||||||
|
|
|
@ -9,7 +9,7 @@ windows.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
menudefs = [
|
menudefs = [
|
||||||
# underscore prefixes character to underscore
|
# underscore prefixes character to underscore
|
||||||
|
|
|
@ -9,8 +9,8 @@ import re
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
|
|
||||||
from . import CallTipWindow
|
from idlelib import CallTipWindow
|
||||||
from .HyperParser import HyperParser
|
from idlelib.HyperParser import HyperParser
|
||||||
|
|
||||||
import __main__
|
import __main__
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import pyclbr
|
import pyclbr
|
||||||
|
|
||||||
from . import PyShell
|
from idlelib import PyShell
|
||||||
from .WindowList import ListedToplevel
|
from idlelib.WindowList import ListedToplevel
|
||||||
from .TreeWidget import TreeNode, TreeItem, ScrolledCanvas
|
from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
class ClassBrowser:
|
class ClassBrowser:
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import Tkinter
|
||||||
from Tkconstants import TOP, LEFT, X, W, SUNKEN
|
from Tkconstants import TOP, LEFT, X, W, SUNKEN
|
||||||
import re
|
import re
|
||||||
from sys import maxint as INFINITY
|
from sys import maxint as INFINITY
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for",
|
BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for",
|
||||||
"if", "try", "while", "with"])
|
"if", "try", "while", "with"])
|
||||||
|
|
|
@ -3,8 +3,8 @@ import re
|
||||||
import keyword
|
import keyword
|
||||||
import __builtin__
|
import __builtin__
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from .Delegator import Delegator
|
from idlelib.Delegator import Delegator
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ class ColorDelegator(Delegator):
|
||||||
self.tag_remove(tag, "1.0", "end")
|
self.tag_remove(tag, "1.0", "end")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
from .Percolator import Percolator
|
from idlelib.Percolator import Percolator
|
||||||
root = Tk()
|
root = Tk()
|
||||||
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
|
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
|
||||||
text = Text(background="white")
|
text = Text(background="white")
|
||||||
|
|
|
@ -2,9 +2,9 @@ import os
|
||||||
import bdb
|
import bdb
|
||||||
import types
|
import types
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from .WindowList import ListedToplevel
|
from idlelib.WindowList import ListedToplevel
|
||||||
from .ScrolledList import ScrolledList
|
from idlelib.ScrolledList import ScrolledList
|
||||||
from . import macosxSupport
|
from idlelib import macosxSupport
|
||||||
|
|
||||||
|
|
||||||
class Idb(bdb.Bdb):
|
class Idb(bdb.Bdb):
|
||||||
|
|
|
@ -10,16 +10,16 @@ import tkMessageBox
|
||||||
import traceback
|
import traceback
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
from .MultiCall import MultiCallCreator
|
from idlelib.MultiCall import MultiCallCreator
|
||||||
from . import idlever
|
from idlelib import idlever
|
||||||
from . import WindowList
|
from idlelib import WindowList
|
||||||
from . import SearchDialog
|
from idlelib import SearchDialog
|
||||||
from . import GrepDialog
|
from idlelib import GrepDialog
|
||||||
from . import ReplaceDialog
|
from idlelib import ReplaceDialog
|
||||||
from . import PyParse
|
from idlelib import PyParse
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
from . import aboutDialog, textView, configDialog
|
from idlelib import aboutDialog, textView, configDialog
|
||||||
from . import macosxSupport
|
from idlelib import macosxSupport
|
||||||
|
|
||||||
# The default tab setting for a Text widget, in average-width characters.
|
# The default tab setting for a Text widget, in average-width characters.
|
||||||
TK_TABWIDTH_DEFAULT = 8
|
TK_TABWIDTH_DEFAULT = 8
|
||||||
|
@ -42,13 +42,13 @@ def _find_module(fullname, path=None):
|
||||||
return file, filename, descr
|
return file, filename, descr
|
||||||
|
|
||||||
class EditorWindow(object):
|
class EditorWindow(object):
|
||||||
from .Percolator import Percolator
|
from idlelib.Percolator import Percolator
|
||||||
from .ColorDelegator import ColorDelegator
|
from idlelib.ColorDelegator import ColorDelegator
|
||||||
from .UndoDelegator import UndoDelegator
|
from idlelib.UndoDelegator import UndoDelegator
|
||||||
from .IOBinding import IOBinding, filesystemencoding, encoding
|
from idlelib.IOBinding import IOBinding, filesystemencoding, encoding
|
||||||
from . import Bindings
|
from idlelib import Bindings
|
||||||
from Tkinter import Toplevel
|
from Tkinter import Toplevel
|
||||||
from .MultiStatusBar import MultiStatusBar
|
from idlelib.MultiStatusBar import MultiStatusBar
|
||||||
|
|
||||||
help_url = None
|
help_url = None
|
||||||
|
|
||||||
|
@ -532,11 +532,11 @@ class EditorWindow(object):
|
||||||
return None
|
return None
|
||||||
head, tail = os.path.split(filename)
|
head, tail = os.path.split(filename)
|
||||||
base, ext = os.path.splitext(tail)
|
base, ext = os.path.splitext(tail)
|
||||||
from . import ClassBrowser
|
from idlelib import ClassBrowser
|
||||||
ClassBrowser.ClassBrowser(self.flist, base, [head])
|
ClassBrowser.ClassBrowser(self.flist, base, [head])
|
||||||
|
|
||||||
def open_path_browser(self, event=None):
|
def open_path_browser(self, event=None):
|
||||||
from . import PathBrowser
|
from idlelib import PathBrowser
|
||||||
PathBrowser.PathBrowser(self.flist)
|
PathBrowser.PathBrowser(self.flist)
|
||||||
|
|
||||||
def gotoline(self, lineno):
|
def gotoline(self, lineno):
|
||||||
|
|
|
@ -5,8 +5,8 @@ import tkMessageBox
|
||||||
|
|
||||||
class FileList:
|
class FileList:
|
||||||
|
|
||||||
from .EditorWindow import EditorWindow # class variable, may be overridden
|
# N.B. this import overridden in PyShellFileList.
|
||||||
# e.g. by PyShellFileList
|
from idlelib.EditorWindow import EditorWindow
|
||||||
|
|
||||||
def __init__(self, root):
|
def __init__(self, root):
|
||||||
self.root = root
|
self.root = root
|
||||||
|
@ -106,7 +106,7 @@ class FileList:
|
||||||
|
|
||||||
|
|
||||||
def _test():
|
def _test():
|
||||||
from .EditorWindow import fixwordbreaks
|
from idlelib.EditorWindow import fixwordbreaks
|
||||||
import sys
|
import sys
|
||||||
root = Tk()
|
root = Tk()
|
||||||
fixwordbreaks(root)
|
fixwordbreaks(root)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# * Fancy comments, like this bulleted list, arent handled :-)
|
# * Fancy comments, like this bulleted list, arent handled :-)
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
class FormatParagraph:
|
class FormatParagraph:
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ import os
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import sys
|
import sys
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from . import SearchEngine
|
from idlelib import SearchEngine
|
||||||
from .SearchDialogBase import SearchDialogBase
|
from idlelib.SearchDialogBase import SearchDialogBase
|
||||||
|
|
||||||
def grep(text, io=None, flist=None):
|
def grep(text, io=None, flist=None):
|
||||||
root = text._root()
|
root = text._root()
|
||||||
|
@ -63,7 +63,7 @@ class GrepDialog(SearchDialogBase):
|
||||||
if not path:
|
if not path:
|
||||||
self.top.bell()
|
self.top.bell()
|
||||||
return
|
return
|
||||||
from .OutputWindow import OutputWindow
|
from idlelib.OutputWindow import OutputWindow
|
||||||
save = sys.stdout
|
save = sys.stdout
|
||||||
try:
|
try:
|
||||||
sys.stdout = OutputWindow(self.flist)
|
sys.stdout = OutputWindow(self.flist)
|
||||||
|
|
|
@ -10,7 +10,7 @@ structure of code, used by extensions to help the user.
|
||||||
|
|
||||||
import string
|
import string
|
||||||
import keyword
|
import keyword
|
||||||
from . import PyParse
|
from idlelib import PyParse
|
||||||
|
|
||||||
class HyperParser:
|
class HyperParser:
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
class History:
|
class History:
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# XXX TO DO:
|
# XXX TO DO:
|
||||||
# - for classes/modules, add "open source" to object browser
|
# - for classes/modules, add "open source" to object browser
|
||||||
|
|
||||||
from .TreeWidget import TreeItem, TreeNode, ScrolledCanvas
|
from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
|
||||||
|
|
||||||
from repr import Repr
|
from repr import Repr
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from .EditorWindow import EditorWindow
|
from idlelib.EditorWindow import EditorWindow
|
||||||
import re
|
import re
|
||||||
import tkMessageBox
|
import tkMessageBox
|
||||||
from . import IOBinding
|
from idlelib import IOBinding
|
||||||
|
|
||||||
class OutputWindow(EditorWindow):
|
class OutputWindow(EditorWindow):
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ paren. Paren here is used generically; the matching applies to
|
||||||
parentheses, square brackets, and curly braces.
|
parentheses, square brackets, and curly braces.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .HyperParser import HyperParser
|
from idlelib.HyperParser import HyperParser
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
_openers = {')':'(',']':'[','}':'{'}
|
_openers = {')':'(',']':'[','}':'{'}
|
||||||
CHECK_DELAY = 100 # miliseconds
|
CHECK_DELAY = 100 # miliseconds
|
||||||
|
|
|
@ -2,8 +2,8 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import imp
|
import imp
|
||||||
|
|
||||||
from .TreeWidget import TreeItem
|
from idlelib.TreeWidget import TreeItem
|
||||||
from .ClassBrowser import ClassBrowser, ModuleBrowserTreeItem
|
from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem
|
||||||
|
|
||||||
class PathBrowser(ClassBrowser):
|
class PathBrowser(ClassBrowser):
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class DirBrowserTreeItem(TreeItem):
|
||||||
return sorted
|
return sorted
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
from . import PyShell
|
from idlelib import PyShell
|
||||||
PathBrowser(PyShell.flist)
|
PathBrowser(PyShell.flist)
|
||||||
if sys.stdin is sys.__stdin__:
|
if sys.stdin is sys.__stdin__:
|
||||||
mainloop()
|
mainloop()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from .WidgetRedirector import WidgetRedirector
|
from idlelib.WidgetRedirector import WidgetRedirector
|
||||||
from .Delegator import Delegator
|
from idlelib.Delegator import Delegator
|
||||||
|
|
||||||
class Percolator:
|
class Percolator:
|
||||||
|
|
||||||
|
|
|
@ -22,17 +22,17 @@ except ImportError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
import tkMessageBox
|
import tkMessageBox
|
||||||
|
|
||||||
from .EditorWindow import EditorWindow, fixwordbreaks
|
from idlelib.EditorWindow import EditorWindow, fixwordbreaks
|
||||||
from .FileList import FileList
|
from idlelib.FileList import FileList
|
||||||
from .ColorDelegator import ColorDelegator
|
from idlelib.ColorDelegator import ColorDelegator
|
||||||
from .UndoDelegator import UndoDelegator
|
from idlelib.UndoDelegator import UndoDelegator
|
||||||
from .OutputWindow import OutputWindow
|
from idlelib.OutputWindow import OutputWindow
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
from . import idlever
|
from idlelib import idlever
|
||||||
from . import rpc
|
from idlelib import rpc
|
||||||
from . import Debugger
|
from idlelib import Debugger
|
||||||
from . import RemoteDebugger
|
from idlelib import RemoteDebugger
|
||||||
from . import macosxSupport
|
from idlelib import macosxSupport
|
||||||
|
|
||||||
LOCALHOST = '127.0.0.1'
|
LOCALHOST = '127.0.0.1'
|
||||||
|
|
||||||
|
@ -541,13 +541,13 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
return
|
return
|
||||||
|
|
||||||
def remote_stack_viewer(self):
|
def remote_stack_viewer(self):
|
||||||
from . import RemoteObjectBrowser
|
from idlelib import RemoteObjectBrowser
|
||||||
oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {})
|
oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {})
|
||||||
if oid is None:
|
if oid is None:
|
||||||
self.tkconsole.root.bell()
|
self.tkconsole.root.bell()
|
||||||
return
|
return
|
||||||
item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid)
|
item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid)
|
||||||
from .TreeWidget import ScrolledCanvas, TreeNode
|
from idlelib.TreeWidget import ScrolledCanvas, TreeNode
|
||||||
top = Toplevel(self.tkconsole.root)
|
top = Toplevel(self.tkconsole.root)
|
||||||
theme = idleConf.GetOption('main','Theme','name')
|
theme = idleConf.GetOption('main','Theme','name')
|
||||||
background = idleConf.GetHighlight(theme, 'normal')['background']
|
background = idleConf.GetHighlight(theme, 'normal')['background']
|
||||||
|
@ -589,7 +589,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
# at the moment, InteractiveInterpreter expects str
|
# at the moment, InteractiveInterpreter expects str
|
||||||
assert isinstance(source, str)
|
assert isinstance(source, str)
|
||||||
#if isinstance(source, str):
|
#if isinstance(source, str):
|
||||||
# from . import IOBinding
|
# from idlelib import IOBinding
|
||||||
# try:
|
# try:
|
||||||
# source = source.encode(IOBinding.encoding)
|
# source = source.encode(IOBinding.encoding)
|
||||||
# except UnicodeError:
|
# except UnicodeError:
|
||||||
|
@ -782,7 +782,7 @@ class PyShell(OutputWindow):
|
||||||
|
|
||||||
|
|
||||||
# New classes
|
# New classes
|
||||||
from .IdleHistory import History
|
from idlelib.IdleHistory import History
|
||||||
|
|
||||||
def __init__(self, flist=None):
|
def __init__(self, flist=None):
|
||||||
if use_subprocess:
|
if use_subprocess:
|
||||||
|
@ -821,7 +821,7 @@ class PyShell(OutputWindow):
|
||||||
self.save_stdout = sys.stdout
|
self.save_stdout = sys.stdout
|
||||||
self.save_stderr = sys.stderr
|
self.save_stderr = sys.stderr
|
||||||
self.save_stdin = sys.stdin
|
self.save_stdin = sys.stdin
|
||||||
from . import IOBinding
|
from idlelib import IOBinding
|
||||||
self.stdout = PseudoFile(self, "stdout", IOBinding.encoding)
|
self.stdout = PseudoFile(self, "stdout", IOBinding.encoding)
|
||||||
self.stderr = PseudoFile(self, "stderr", IOBinding.encoding)
|
self.stderr = PseudoFile(self, "stderr", IOBinding.encoding)
|
||||||
self.console = PseudoFile(self, "console", IOBinding.encoding)
|
self.console = PseudoFile(self, "console", IOBinding.encoding)
|
||||||
|
@ -992,7 +992,7 @@ class PyShell(OutputWindow):
|
||||||
if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C
|
if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C
|
||||||
line = "\n"
|
line = "\n"
|
||||||
if isinstance(line, str):
|
if isinstance(line, str):
|
||||||
from . import IOBinding
|
from idlelib import IOBinding
|
||||||
try:
|
try:
|
||||||
line = line.encode(IOBinding.encoding)
|
line = line.encode(IOBinding.encoding)
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
|
@ -1180,7 +1180,7 @@ class PyShell(OutputWindow):
|
||||||
"(sys.last_traceback is not defined)",
|
"(sys.last_traceback is not defined)",
|
||||||
master=self.text)
|
master=self.text)
|
||||||
return
|
return
|
||||||
from .StackViewer import StackBrowser
|
from idlelib.StackViewer import StackBrowser
|
||||||
sv = StackBrowser(self.root, self.flist)
|
sv = StackBrowser(self.root, self.flist)
|
||||||
|
|
||||||
def view_restart_mark(self, event=None):
|
def view_restart_mark(self, event=None):
|
||||||
|
|
|
@ -22,8 +22,8 @@ barrier, in particular frame and traceback objects.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
from . import rpc
|
from idlelib import rpc
|
||||||
from . import Debugger
|
from idlelib import Debugger
|
||||||
|
|
||||||
debugging = 0
|
debugging = 0
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from . import rpc
|
from idlelib import rpc
|
||||||
|
|
||||||
def remote_object_tree_item(item):
|
def remote_object_tree_item(item):
|
||||||
wrapper = WrappedObjectTreeItem(item)
|
wrapper = WrappedObjectTreeItem(item)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
|
|
||||||
from . import SearchEngine
|
from idlelib import SearchEngine
|
||||||
from .SearchDialogBase import SearchDialogBase
|
from idlelib.SearchDialogBase import SearchDialogBase
|
||||||
|
|
||||||
def replace(text):
|
def replace(text):
|
||||||
root = text._root()
|
root = text._root()
|
||||||
|
|
|
@ -23,10 +23,10 @@ import string
|
||||||
import tabnanny
|
import tabnanny
|
||||||
import tokenize
|
import tokenize
|
||||||
import tkMessageBox
|
import tkMessageBox
|
||||||
from .EditorWindow import EditorWindow
|
from idlelib.EditorWindow import EditorWindow
|
||||||
from . import PyShell
|
from idlelib import PyShell
|
||||||
|
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
indent_message = """Error: Inconsistent indentation detected!
|
indent_message = """Error: Inconsistent indentation detected!
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
|
|
||||||
from . import SearchEngine
|
from idlelib import SearchEngine
|
||||||
from .SearchDialogBase import SearchDialogBase
|
from idlelib.SearchDialogBase import SearchDialogBase
|
||||||
|
|
||||||
def _setup(text):
|
def _setup(text):
|
||||||
root = text._root()
|
root = text._root()
|
||||||
|
|
|
@ -2,8 +2,8 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import linecache
|
import linecache
|
||||||
|
|
||||||
from .TreeWidget import TreeNode, TreeItem, ScrolledCanvas
|
from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
|
||||||
from .ObjectBrowser import ObjectTreeItem, make_objecttreeitem
|
from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
|
||||||
|
|
||||||
def StackBrowser(root, flist=None, tb=None, top=None):
|
def StackBrowser(root, flist=None, tb=None, top=None):
|
||||||
if top is None:
|
if top is None:
|
||||||
|
|
|
@ -19,8 +19,8 @@ import sys
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import imp
|
import imp
|
||||||
|
|
||||||
from . import ZoomHeight
|
from idlelib import ZoomHeight
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
|
|
||||||
ICONDIR = "Icons"
|
ICONDIR = "Icons"
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ class ScrolledCanvas:
|
||||||
# Testing functions
|
# Testing functions
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
from . import PyShell
|
from idlelib import PyShell
|
||||||
root = Toplevel(PyShell.root)
|
root = Toplevel(PyShell.root)
|
||||||
root.configure(bd=0, bg="yellow")
|
root.configure(bd=0, bg="yellow")
|
||||||
root.focus_set()
|
root.focus_set()
|
||||||
|
|
|
@ -2,7 +2,7 @@ import sys
|
||||||
import string
|
import string
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
|
|
||||||
from .Delegator import Delegator
|
from idlelib.Delegator import Delegator
|
||||||
|
|
||||||
#$ event <<redo>>
|
#$ event <<redo>>
|
||||||
#$ win <Control-y>
|
#$ win <Control-y>
|
||||||
|
@ -338,7 +338,7 @@ class CommandSequence(Command):
|
||||||
return self.depth
|
return self.depth
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
from .Percolator import Percolator
|
from idlelib.Percolator import Percolator
|
||||||
root = Tk()
|
root = Tk()
|
||||||
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
|
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
|
||||||
text = Text()
|
text = Text()
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from . import macosxSupport
|
from idlelib import macosxSupport
|
||||||
|
|
||||||
class ZoomHeight:
|
class ZoomHeight:
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from . import textView
|
from idlelib import textView
|
||||||
from . import idlever
|
from idlelib import idlever
|
||||||
|
|
||||||
class AboutDialog(Toplevel):
|
class AboutDialog(Toplevel):
|
||||||
"""Modal about dialog for idle
|
"""Modal about dialog for idle
|
||||||
|
@ -158,7 +158,7 @@ if __name__ == '__main__':
|
||||||
# test the dialog
|
# test the dialog
|
||||||
root = Tk()
|
root = Tk()
|
||||||
def run():
|
def run():
|
||||||
from . import aboutDialog
|
from idlelib import aboutDialog
|
||||||
aboutDialog.AboutDialog(root, 'About')
|
aboutDialog.AboutDialog(root, 'About')
|
||||||
Button(root, text='Dialog', command=run).pack()
|
Button(root, text='Dialog', command=run).pack()
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|
|
@ -13,12 +13,12 @@ from Tkinter import *
|
||||||
import tkMessageBox, tkColorChooser, tkFont
|
import tkMessageBox, tkColorChooser, tkFont
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from .configHandler import idleConf
|
from idlelib.configHandler import idleConf
|
||||||
from .dynOptionMenuWidget import DynOptionMenu
|
from idlelib.dynOptionMenuWidget import DynOptionMenu
|
||||||
from .tabpage import TabPageSet
|
from idlelib.tabpage import TabPageSet
|
||||||
from .keybindingDialog import GetKeysDialog
|
from idlelib.keybindingDialog import GetKeysDialog
|
||||||
from .configSectionNameDialog import GetCfgSectionNameDialog
|
from idlelib.configSectionNameDialog import GetCfgSectionNameDialog
|
||||||
from .configHelpSourceEdit import GetHelpSourceDialog
|
from idlelib.configHelpSourceEdit import GetHelpSourceDialog
|
||||||
|
|
||||||
class ConfigDialog(Toplevel):
|
class ConfigDialog(Toplevel):
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ configuration problem notification and resolution.
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from . import macosxSupport
|
from idlelib import macosxSupport
|
||||||
from .ConfigParser import ConfigParser, NoOptionError, NoSectionError
|
from ConfigParser import ConfigParser, NoOptionError, NoSectionError
|
||||||
|
|
||||||
class InvalidConfigType(Exception): pass
|
class InvalidConfigType(Exception): pass
|
||||||
class InvalidConfigSet(Exception): pass
|
class InvalidConfigSet(Exception): pass
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
try:
|
try:
|
||||||
import idlelib.PyShell
|
import idlelib, idlelib.PyShell
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# IDLE is not installed, but maybe PyShell is on sys.path:
|
# IDLE is not installed, but maybe PyShell is on sys.path:
|
||||||
|
print("*** idle.py import error! Trying alternate approach....")
|
||||||
try:
|
try:
|
||||||
from . import PyShell
|
import PyShell
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -47,10 +47,10 @@ def overrideRootMenu(root, flist):
|
||||||
# Due to a (mis-)feature of TkAqua the user will also see an empty Help
|
# Due to a (mis-)feature of TkAqua the user will also see an empty Help
|
||||||
# menu.
|
# menu.
|
||||||
from Tkinter import Menu, Text, Text
|
from Tkinter import Menu, Text, Text
|
||||||
from .EditorWindow import prepstr, get_accelerator
|
from idlelib.EditorWindow import prepstr, get_accelerator
|
||||||
from . import Bindings
|
from idlelib import Bindings
|
||||||
from . import WindowList
|
from idlelib import WindowList
|
||||||
from .MultiCall import MultiCallCreator
|
from idlelib.MultiCall import MultiCallCreator
|
||||||
|
|
||||||
menubar = Menu(root)
|
menubar = Menu(root)
|
||||||
root.configure(menu=menubar)
|
root.configure(menu=menubar)
|
||||||
|
@ -73,11 +73,11 @@ def overrideRootMenu(root, flist):
|
||||||
menubar.add_cascade(label='IDLE', menu=menu)
|
menubar.add_cascade(label='IDLE', menu=menu)
|
||||||
|
|
||||||
def about_dialog(event=None):
|
def about_dialog(event=None):
|
||||||
from . import aboutDialog
|
from idlelib import aboutDialog
|
||||||
aboutDialog.AboutDialog(root, 'About IDLE')
|
aboutDialog.AboutDialog(root, 'About IDLE')
|
||||||
|
|
||||||
def config_dialog(event=None):
|
def config_dialog(event=None):
|
||||||
from . import configDialog
|
from idlelib import configDialog
|
||||||
configDialog.ConfigDialog(root, 'Settings')
|
configDialog.ConfigDialog(root, 'Settings')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,13 @@ import thread
|
||||||
import threading
|
import threading
|
||||||
import Queue
|
import Queue
|
||||||
|
|
||||||
from . import CallTips
|
from idlelib import CallTips
|
||||||
from . import AutoComplete
|
from idlelib import AutoComplete
|
||||||
|
|
||||||
from . import RemoteDebugger
|
from idlelib import RemoteDebugger
|
||||||
from . import RemoteObjectBrowser
|
from idlelib import RemoteObjectBrowser
|
||||||
from . import StackViewer
|
from idlelib import StackViewer
|
||||||
from . import rpc
|
from idlelib import rpc
|
||||||
|
|
||||||
import __main__
|
import __main__
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ class MyHandler(rpc.RPCHandler):
|
||||||
sys.stdin = self.console = self.get_remote_proxy("stdin")
|
sys.stdin = self.console = self.get_remote_proxy("stdin")
|
||||||
sys.stdout = self.get_remote_proxy("stdout")
|
sys.stdout = self.get_remote_proxy("stdout")
|
||||||
sys.stderr = self.get_remote_proxy("stderr")
|
sys.stderr = self.get_remote_proxy("stderr")
|
||||||
from . import IOBinding
|
from idlelib import IOBinding
|
||||||
sys.stdin.encoding = sys.stdout.encoding = \
|
sys.stdin.encoding = sys.stdout.encoding = \
|
||||||
sys.stderr.encoding = IOBinding.encoding
|
sys.stderr.encoding = IOBinding.encoding
|
||||||
self.interp = self.get_remote_proxy("interp")
|
self.interp = self.get_remote_proxy("interp")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue