diff -r d9e490f72476 Lib/idlelib/__main__.py --- a/Lib/idlelib/__main__.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/__main__.py Tue May 19 03:18:15 2015 -0700 @@ -3,6 +3,6 @@ Run IDLE as python -m idlelib """ -import idlelib.PyShell -idlelib.PyShell.main() +import idlelib.pyshell +idlelib.pyshell.main() # This file does not work for 2.7; See issue 24212. diff -r d9e490f72476 Lib/idlelib/about_dialog.py --- a/Lib/idlelib/about_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/about_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -5,7 +5,7 @@ import os from sys import version from tkinter import * -from idlelib import textView +from idlelib import text_view class AboutDialog(Toplevel): """Modal about dialog for idle @@ -132,11 +132,11 @@ def display_printer_text(self, title, printer): printer._Printer__setup() text = '\n'.join(printer._Printer__lines) - textView.view_text(self, title, text) + text_view.view_text(self, title, text) def display_file_text(self, title, filename, encoding=None): fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), filename) - textView.view_file(self, title, fn, encoding) + text_view.view_file(self, title, fn, encoding) def Ok(self, event=None): self.destroy() diff -r d9e490f72476 Lib/idlelib/autocomplete.py --- a/Lib/idlelib/autocomplete.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/autocomplete.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -"""AutoComplete.py - An IDLE extension for automatically completing names. +"""auto_complete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. @@ -7,7 +7,7 @@ import sys import string -from idlelib.configHandler import idleConf +from idlelib.config_handler import idleConf # This string includes all chars that may be in an identifier ID_CHARS = string.ascii_letters + string.digits + "_" @@ -15,8 +15,8 @@ # These constants represent the two different types of completions COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1) -from idlelib import AutoCompleteWindow -from idlelib.HyperParser import HyperParser +from idlelib import autocomplete_window +from idlelib.hyper_parser import HyperParser import __main__ @@ -49,7 +49,7 @@ self._delayed_completion_index = None def _make_autocomplete_window(self): - return AutoCompleteWindow.AutoCompleteWindow(self.text) + return autocomplete_window.AutoCompleteWindow(self.text) def _remove_autocomplete_window(self, event=None): if self.autocompletewindow: diff -r d9e490f72476 Lib/idlelib/autocomplete_window.py --- a/Lib/idlelib/autocomplete_window.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/autocomplete_window.py Tue May 19 03:18:15 2015 -0700 @@ -2,8 +2,8 @@ An auto-completion window for IDLE, used by the AutoComplete extension """ from tkinter import * -from idlelib.MultiCall import MC_SHIFT -from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES +from idlelib.multi_call import MC_SHIFT +from idlelib.autocomplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES HIDE_VIRTUAL_EVENT_NAME = "<>" HIDE_SEQUENCES = ("", "") @@ -34,8 +34,8 @@ self.completions = None # A list with more completions, or None self.morecompletions = None - # The completion mode. Either AutoComplete.COMPLETE_ATTRIBUTES or - # AutoComplete.COMPLETE_FILES + # The completion mode. Either autocomplete.COMPLETE_ATTRIBUTES or + # autocomplete.COMPLETE_FILES self.mode = None # The current completion start, on the text box (a string) self.start = None diff -r d9e490f72476 Lib/idlelib/bindings.py --- a/Lib/idlelib/bindings.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/bindings.py Tue May 19 03:18:15 2015 -0700 @@ -10,9 +10,9 @@ """ from importlib.util import find_spec -from idlelib.configHandler import idleConf +from idlelib.config_handler import idleConf -# Warning: menudefs is altered in macosxSupport.overrideRootMenu() +# Warning: menudefs is altered in mac_osx_support.overrideRootMenu() # after it is determined that an OS X Aqua Tk is in use, # which cannot be done until after Tk() is first called. # Do not alter the 'file', 'options', or 'help' cascades here diff -r d9e490f72476 Lib/idlelib/calltip_window.py --- a/Lib/idlelib/calltip_window.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/calltip_window.py Tue May 19 03:18:15 2015 -0700 @@ -1,6 +1,6 @@ """A CallTip window class for Tkinter/IDLE. -After ToolTip.py, which uses ideas gleaned from PySol +After tool_tip.py, which uses ideas gleaned from PySol Used by the CallTips IDLE extension. """ from tkinter import Toplevel, Label, LEFT, SOLID, TclError diff -r d9e490f72476 Lib/idlelib/calltips.py --- a/Lib/idlelib/calltips.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/calltips.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -"""CallTips.py - An IDLE Extension to Jog Your Memory +"""calltips.py - An IDLE Extension to Jog Your Memory Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and @@ -12,8 +12,8 @@ import textwrap import types -from idlelib import CallTipWindow -from idlelib.HyperParser import HyperParser +from idlelib import calltip_window +from idlelib.hyper_parser import HyperParser class CallTips: @@ -37,7 +37,7 @@ def _make_tk_calltip_window(self): # See __init__ for usage - return CallTipWindow.CallTip(self.text) + return calltip_window.CallTip(self.text) def _remove_calltip_window(self, event=None): if self.active_calltip: diff -r d9e490f72476 Lib/idlelib/class_browser.py --- a/Lib/idlelib/class_browser.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/class_browser.py Tue May 19 03:18:15 2015 -0700 @@ -14,13 +14,13 @@ import sys import pyclbr -from idlelib import PyShell -from idlelib.WindowList import ListedToplevel -from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from idlelib.configHandler import idleConf +from idlelib import pyshell +from idlelib.window_list import ListedToplevel +from idlelib.tree_widget import TreeNode, TreeItem, ScrolledCanvas +from idlelib.config_handler import idleConf file_open = None # Method...Item and Class...Item use this. -# Normally PyShell.flist.open, but there is no PyShell.flist for htest. +# Normally pyshell.flist.open, but there is no pyshell.flist for htest. class ClassBrowser: @@ -32,7 +32,7 @@ """ global file_open if not _htest: - file_open = PyShell.flist.open + file_open = pyshell.flist.open self.name = name self.file = os.path.join(path[0], self.name + ".py") self._htest = _htest @@ -95,7 +95,7 @@ return if not os.path.exists(self.file): return - PyShell.flist.open(self.file) + pyshell.flist.open(self.file) def IsExpandable(self): return os.path.normcase(self.file[-3:]) == ".py" @@ -226,7 +226,7 @@ file = sys.argv[0] dir, file = os.path.split(file) name = os.path.splitext(file)[0] - flist = PyShell.PyShellFileList(parent) + flist = pyshell.PyShellFileList(parent) global file_open file_open = flist.open ClassBrowser(flist, name, [dir], _htest=True) diff -r d9e490f72476 Lib/idlelib/code_context.py --- a/Lib/idlelib/code_context.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/code_context.py Tue May 19 03:18:15 2015 -0700 @@ -13,7 +13,7 @@ from tkinter.constants import TOP, LEFT, X, W, SUNKEN import re from sys import maxsize as INFINITY -from idlelib.configHandler import idleConf +from idlelib.config_handler import idleConf BLOCKOPENERS = {"class", "def", "elif", "else", "except", "finally", "for", "if", "try", "while", "with"} diff -r d9e490f72476 Lib/idlelib/color_delegator.py --- a/Lib/idlelib/color_delegator.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/color_delegator.py Tue May 19 03:18:15 2015 -0700 @@ -2,8 +2,8 @@ import re import keyword import builtins -from idlelib.Delegator import Delegator -from idlelib.configHandler import idleConf +from idlelib.delegator import Delegator +from idlelib.config_handler import idleConf DEBUG = False @@ -235,7 +235,7 @@ def _color_delegator(parent): # htest # from tkinter import Toplevel, Text - from idlelib.Percolator import Percolator + from idlelib.percolator import Percolator top = Toplevel(parent) top.title("Test ColorDelegator") diff -r d9e490f72476 Lib/idlelib/config_dialog.py --- a/Lib/idlelib/config_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/config_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -14,13 +14,13 @@ import tkinter.colorchooser as tkColorChooser import tkinter.font as tkFont -from idlelib.configHandler import idleConf -from idlelib.dynOptionMenuWidget import DynOptionMenu -from idlelib.keybindingDialog import GetKeysDialog -from idlelib.configSectionNameDialog import GetCfgSectionNameDialog -from idlelib.configHelpSourceEdit import GetHelpSourceDialog -from idlelib.tabbedpages import TabbedPageSet -from idlelib import macosxSupport +from idlelib.config_handler import idleConf +from idlelib.dyn_option_menu_widget import DynOptionMenu +from idlelib.keybinding_dialog import GetKeysDialog +from idlelib.config_section_name_dialog import GetCfgSectionNameDialog +from idlelib.config_help_source_edit import GetHelpSourceDialog +from idlelib.tabbed_pages import TabbedPageSet +from idlelib import mac_osx_support class ConfigDialog(Toplevel): def __init__(self, parent, title='', _htest=False, _utest=False): @@ -85,7 +85,7 @@ self.CreatePageGeneral() self.create_action_buttons().pack(side=BOTTOM) def create_action_buttons(self): - if macosxSupport.isAquaTk(): + if mac_osx_support.isAquaTk(): # Changing the default padding on OSX results in unreadable # text in the buttons paddingArgs = {} diff -r d9e490f72476 Lib/idlelib/config_handler.py --- a/Lib/idlelib/config_handler.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/config_handler.py Tue May 19 03:18:15 2015 -0700 @@ -7,7 +7,7 @@ and if a file becomes empty, it will be deleted. The contents of the user files may be altered using the Options/Configure IDLE -menu to access the configuration GUI (configDialog.py), or manually. +menu to access the configuration GUI (config_dialog.py), or manually. Throughout this module there is an emphasis on returning useable defaults when a problem occurs in returning a requested configuration value back to @@ -228,7 +228,7 @@ return self.userCfg[configType].Get(section, option, type=type, raw=raw) except ValueError: - warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n' + warning = ('\n Warning: config_handler.py - IdleConf.GetOption -\n' ' invalid %r value for configuration option %r\n' ' from section %r: %r' % (type, option, section, @@ -245,7 +245,7 @@ pass #returning default, print warning if warn_on_default: - warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n' + warning = ('\n Warning: config_handler.py - IdleConf.GetOption -\n' ' problem retrieving configuration option %r\n' ' from section %r.\n' ' returning default value: %r' % @@ -356,7 +356,7 @@ for element in theme: if not cfgParser.has_option(themeName, element): # Print warning that will return a default color - warning = ('\n Warning: configHandler.IdleConf.GetThemeDict' + warning = ('\n Warning: config_handler.IdleConf.GetThemeDict' ' -\n problem retrieving theme element %r' '\n from theme %r.\n' ' returning default color: %r' % @@ -618,7 +618,7 @@ if binding: keyBindings[event] = binding else: #we are going to return a default, print warning - warning=('\n Warning: configHandler.py - IdleConf.GetCoreKeys' + warning=('\n Warning: config_handler.py - IdleConf.GetCoreKeys' ' -\n problem retrieving key binding for event %r' '\n from key set %r.\n' ' returning default value: %r' % diff -r d9e490f72476 Lib/idlelib/config_section_name_dialog.py --- a/Lib/idlelib/config_section_name_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/config_section_name_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -1,7 +1,7 @@ """ Dialog that allows user to specify a new config file section name. Used to get new highlight theme and keybinding set names. -The 'return value' for the dialog, used two placed in configDialog.py, +The 'return value' for the dialog, used two placed in config_dialog.py, is the .result attribute set in the Ok and Cancel methods. """ from tkinter import * diff -r d9e490f72476 Lib/idlelib/debugger.py --- a/Lib/idlelib/debugger.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/debugger.py Tue May 19 03:18:15 2015 -0700 @@ -1,9 +1,9 @@ import os import bdb from tkinter import * -from idlelib.WindowList import ListedToplevel -from idlelib.ScrolledList import ScrolledList -from idlelib import macosxSupport +from idlelib.window_list import ListedToplevel +from idlelib.scrolled_list import ScrolledList +from idlelib import mac_osx_support class Idb(bdb.Bdb): @@ -31,8 +31,8 @@ return True else: prev_frame = frame.f_back - if prev_frame.f_code.co_filename.count('Debugger.py'): - # (that test will catch both Debugger.py and RemoteDebugger.py) + if prev_frame.f_code.co_filename.count('debugger.py'): + # (that test will catch both debugger.py and remote_debugger.py) return False return self.in_rpc_code(prev_frame) @@ -321,7 +321,7 @@ class StackViewer(ScrolledList): def __init__(self, master, flist, gui): - if macosxSupport.isAquaTk(): + if mac_osx_support.isAquaTk(): # At least on with the stock AquaTk version on OSX 10.4 you'll # get an shaking GUI that eventually kills IDLE if the width # argument is specified. @@ -453,7 +453,7 @@ # # There is also an obscure bug in sorted(dict) where the # interpreter gets into a loop requesting non-existing dict[0], - # dict[1], dict[2], etc from the RemoteDebugger.DictProxy. + # dict[1], dict[2], etc from the remote_debugger.DictProxy. ### keys_list = dict.keys() names = sorted(keys_list) diff -r d9e490f72476 Lib/idlelib/editor_window.py --- a/Lib/idlelib/editor_window.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/editor_window.py Tue May 19 03:18:15 2015 -0700 @@ -12,15 +12,15 @@ import traceback import webbrowser -from idlelib.MultiCall import MultiCallCreator -from idlelib import WindowList -from idlelib import SearchDialog -from idlelib import GrepDialog -from idlelib import ReplaceDialog -from idlelib import PyParse -from idlelib.configHandler import idleConf -from idlelib import aboutDialog, textView, configDialog -from idlelib import macosxSupport +from idlelib.multi_call import MultiCallCreator +from idlelib import window_list +from idlelib import search_dialog +from idlelib import grep_dialog +from idlelib import replace_dialog +from idlelib import pyparse +from idlelib.config_handler import idleConf +from idlelib import about_dialog, text_view, config_dialog +from idlelib import mac_osx_support # The default tab setting for a Text widget, in average-width characters. TK_TABWIDTH_DEFAULT = 8 @@ -61,7 +61,7 @@ def show_dialog(self, parent): self.parent = parent fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') - self.dlg = dlg = textView.view_file(parent,'Help',fn, modal=False) + self.dlg = dlg = text_view.view_file(parent,'Help',fn, modal=False) dlg.bind('', self.destroy, '+') def nearwindow(self, near): @@ -85,13 +85,13 @@ class EditorWindow(object): - from idlelib.Percolator import Percolator - from idlelib.ColorDelegator import ColorDelegator - from idlelib.UndoDelegator import UndoDelegator - from idlelib.IOBinding import IOBinding, filesystemencoding, encoding - from idlelib import Bindings + from idlelib.percolator import Percolator + from idlelib.color_delegator import ColorDelegator + from idlelib.undo_delegator import UndoDelegator + from idlelib.io_binding import IOBinding, filesystemencoding, encoding + from idlelib import bindings from tkinter import Toplevel - from idlelib.MultiStatusBar import MultiStatusBar + from idlelib.multi_status_bar import MultiStatusBar help_url = None @@ -132,11 +132,11 @@ except AttributeError: sys.ps1 = '>>> ' self.menubar = Menu(root) - self.top = top = WindowList.ListedToplevel(root, menu=self.menubar) + self.top = top = window_list.ListedToplevel(root, menu=self.menubar) if flist: self.tkinter_vars = flist.vars #self.top.instance_dict makes flist.inversedict available to - #configDialog.py so it can access all EditorWindow instances + #config_dialog.py so it can access all EditorWindow instances self.top.instance_dict = flist.inversedict else: self.tkinter_vars = {} # keys: Tkinter event names @@ -168,7 +168,7 @@ self.top.protocol("WM_DELETE_WINDOW", self.close) self.top.bind("<>", self.close_event) - if macosxSupport.isAquaTk(): + if mac_osx_support.isAquaTk(): # Command-W on editorwindows doesn't work without this. text.bind('<>', self.close_event) # Some OS X systems have only one mouse button, @@ -312,7 +312,7 @@ menu.add_separator() end = end + 1 self.wmenu_end = end - WindowList.register_callback(self.postwindowsmenu) + window_list.register_callback(self.postwindowsmenu) # Some abstractions so IDLE extensions are cross-IDE self.askyesno = tkMessageBox.askyesno @@ -449,7 +449,7 @@ underline, label = prepstr(label) menudict[name] = menu = Menu(mbar, name=name) mbar.add_cascade(label=label, menu=menu, underline=underline) - if macosxSupport.isCarbonTk(): + if mac_osx_support.isCarbonTk(): # Insert the application menu menudict['application'] = menu = Menu(mbar, name='apple') mbar.add_cascade(label='IDLE', menu=menu) @@ -469,7 +469,7 @@ end = -1 if end > self.wmenu_end: menu.delete(self.wmenu_end+1, end) - WindowList.add_windows_to_menu(menu) + window_list.add_windows_to_menu(menu) rmenu = None @@ -536,12 +536,12 @@ return 'normal' def about_dialog(self, event=None): - aboutDialog.AboutDialog(self.top,'About IDLE') + about_dialog.AboutDialog(self.top,'About IDLE') def config_dialog(self, event=None): - configDialog.ConfigDialog(self.top,'Settings') + config_dialog.ConfigDialog(self.top,'Settings') def config_extensions_dialog(self, event=None): - configDialog.ConfigExtensionsDialog(self.top) + config_dialog.ConfigExtensionsDialog(self.top) def help_dialog(self, event=None): if self.root: @@ -616,23 +616,23 @@ return "break" def find_event(self, event): - SearchDialog.find(self.text) + search_dialog.find(self.text) return "break" def find_again_event(self, event): - SearchDialog.find_again(self.text) + search_dialog.find_again(self.text) return "break" def find_selection_event(self, event): - SearchDialog.find_selection(self.text) + search_dialog.find_selection(self.text) return "break" def find_in_files_event(self, event): - GrepDialog.grep(self.text, self.io, self.flist) + grep_dialog.grep(self.text, self.io, self.flist) return "break" def replace_event(self, event): - ReplaceDialog.replace(self.text) + replace_dialog.replace(self.text) return "break" def goto_line_event(self, event): @@ -699,12 +699,12 @@ return head, tail = os.path.split(filename) base, ext = os.path.splitext(tail) - from idlelib import ClassBrowser - ClassBrowser.ClassBrowser(self.flist, base, [head]) + from idlelib import class_browser + class_browser.ClassBrowser(self.flist, base, [head]) def open_path_browser(self, event=None): from idlelib import PathBrowser - PathBrowser.PathBrowser(self.flist) + path_browser.PathBrowser(self.flist) def open_turtle_demo(self, event = None): import subprocess @@ -765,7 +765,7 @@ def ResetColorizer(self): "Update the color theme" - # Called from self.filename_change_hook and from configDialog.py + # Called from self.filename_change_hook and from config_dialog.py self._rmcolorizer() self._addcolorizer() theme = idleConf.GetOption('main','Theme','name') @@ -795,7 +795,7 @@ def ResetFont(self): "Update the text widgets' font if it is changed" - # Called from configDialog.py + # Called from config_dialog.py fontWeight='normal' if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'): fontWeight='bold' @@ -806,7 +806,7 @@ def RemoveKeybindings(self): "Remove the keybindings before they are changed." - # Called from configDialog.py + # Called from config_dialog.py self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet() for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) @@ -818,7 +818,7 @@ def ApplyKeybindings(self): "Update the keybindings after they are changed" - # Called from configDialog.py + # Called from config_dialog.py self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): @@ -854,7 +854,7 @@ def set_notabs_indentwidth(self): "Update the indentwidth if changed and not using tabs in this window" - # Called from configDialog.py + # Called from config_dialog.py if not self.usetabs: self.indentwidth = idleConf.GetOption('main', 'Indent','num-spaces', type='int') @@ -1032,7 +1032,7 @@ def _close(self): if self.io.filename: self.update_recent_files_list(new_file=self.io.filename) - WindowList.unregister_callback(self.postwindowsmenu) + window_list.unregister_callback(self.postwindowsmenu) self.unload_extensions() self.io.close() self.io = None @@ -1341,7 +1341,7 @@ # adjust indentation for continuations and block # open/close first need to find the last stmt lno = index2line(text.index('insert')) - y = PyParse.Parser(self.indentwidth, self.tabwidth) + y = pyparse.Parser(self.indentwidth, self.tabwidth) if not self.context_use_ps1: for context in self.num_context_lines: startat = max(lno - context, 1) @@ -1365,22 +1365,22 @@ y.set_lo(0) c = y.get_continuation_type() - if c != PyParse.C_NONE: + if c != pyparse.C_NONE: # The current stmt hasn't ended yet. - if c == PyParse.C_STRING_FIRST_LINE: + if c == pyparse.C_STRING_FIRST_LINE: # after the first line of a string; do not indent at all pass - elif c == PyParse.C_STRING_NEXT_LINES: + elif c == pyparse.C_STRING_NEXT_LINES: # inside a string which started before this line; # just mimic the current indent text.insert("insert", indent) - elif c == PyParse.C_BRACKET: + elif c == pyparse.C_BRACKET: # line up with the first (if any) element of the # last open bracket structure; else indent one # level beyond the indent of the line with the # last open bracket self.reindent_to(y.compute_bracket_indent()) - elif c == PyParse.C_BACKSLASH: + elif c == pyparse.C_BACKSLASH: # if more than one line in this stmt already, just # mimic the current indent; else if initial line # has a start on an assignment stmt, indent to @@ -1683,7 +1683,7 @@ keylist = keydefs.get(eventname) # issue10940: temporary workaround to prevent hang with OS X Cocoa Tk 8.5 # if not keylist: - if (not keylist) or (macosxSupport.isCocoaTk() and eventname in { + if (not keylist) or (mac_osx_support.isCocoaTk() and eventname in { "<>", "<>", "<>"}): @@ -1718,7 +1718,7 @@ filename = sys.argv[1] else: filename = None - macosxSupport.setupApp(root, None) + mac_osx_support.setupApp(root, None) edit = EditorWindow(root=root, filename=filename) edit.text.bind("<>", edit.close_event) # Does not stop error, neither does following diff -r d9e490f72476 Lib/idlelib/file_list.py --- a/Lib/idlelib/file_list.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/file_list.py Tue May 19 03:18:15 2015 -0700 @@ -6,7 +6,7 @@ class FileList: # N.B. this import overridden in PyShellFileList. - from idlelib.EditorWindow import EditorWindow + from idlelib.editor_window import EditorWindow def __init__(self, root): self.root = root diff -r d9e490f72476 Lib/idlelib/format_paragraph.py --- a/Lib/idlelib/format_paragraph.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/format_paragraph.py Tue May 19 03:18:15 2015 -0700 @@ -16,7 +16,7 @@ """ import re -from idlelib.configHandler import idleConf +from idlelib.config_handler import idleConf class FormatParagraph: diff -r d9e490f72476 Lib/idlelib/grep_dialog.py --- a/Lib/idlelib/grep_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/grep_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -4,14 +4,14 @@ import sys from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog from tkinter import Tk, Text, Button, SEL, END # for htest -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import search_engine +from idlelib.search_dialog_base import SearchDialogBase # Importing OutputWindow fails due to import loop # EditorWindow -> GrepDialop -> OutputWindow -> EditorWindow def grep(text, io=None, flist=None): root = text._root() - engine = SearchEngine.get(root) + engine = search_engine.get(root) if not hasattr(engine, "_grepdialog"): engine._grepdialog = GrepDialog(root, engine, flist) dialog = engine._grepdialog @@ -67,7 +67,7 @@ if not path: self.top.bell() return - from idlelib.OutputWindow import OutputWindow # leave here! + from idlelib.output_window import OutputWindow # leave here! save = sys.stdout try: sys.stdout = OutputWindow(self.flist) @@ -131,7 +131,7 @@ def _grep_dialog(parent): # htest # - from idlelib.PyShell import PyShellFileList + from idlelib.pyshell import PyShellFileList root = Tk() root.title("Test GrepDialog") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff -r d9e490f72476 Lib/idlelib/hyper_parser.py --- a/Lib/idlelib/hyper_parser.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/hyper_parser.py Tue May 19 03:18:15 2015 -0700 @@ -7,7 +7,7 @@ import string from keyword import iskeyword -from idlelib import PyParse +from idlelib import pyparse # all ASCII chars that may be in an identifier @@ -30,7 +30,7 @@ self.editwin = editwin self.text = text = editwin.text - parser = PyParse.Parser(editwin.indentwidth, editwin.tabwidth) + parser = pyparse.Parser(editwin.indentwidth, editwin.tabwidth) def index2line(index): return int(float(index)) diff -r d9e490f72476 Lib/idlelib/idle.py --- a/Lib/idlelib/idle.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle.py Tue May 19 03:18:15 2015 -0700 @@ -7,5 +7,5 @@ idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, idlelib_dir) -import idlelib.PyShell -idlelib.PyShell.main() +import idlelib.pyshell +idlelib.pyshell.main() diff -r d9e490f72476 Lib/idlelib/idle.pyw --- a/Lib/idlelib/idle.pyw Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle.pyw Tue May 19 03:18:15 2015 -0700 @@ -1,14 +1,14 @@ try: - import idlelib.PyShell + import idlelib.pyshell except ImportError: - # IDLE is not installed, but maybe PyShell is on sys.path: + # IDLE is not installed, but maybe pyshell is on sys.path: try: - from . import PyShell + from . import pyshell except ImportError: raise else: import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) + idledir = os.path.dirname(os.path.abspath(pyshell.__file__)) if idledir != os.getcwd(): # We're not in the IDLE directory, help the subprocess find run.py pypath = os.environ.get('PYTHONPATH', '') @@ -16,6 +16,6 @@ os.environ['PYTHONPATH'] = pypath + ':' + idledir else: os.environ['PYTHONPATH'] = idledir - PyShell.main() + pyshell.main() else: - idlelib.PyShell.main() + idlelib.pyshell.main() diff -r d9e490f72476 Lib/idlelib/idle_history.py --- a/Lib/idlelib/idle_history.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_history.py Tue May 19 03:18:15 2015 -0700 @@ -1,11 +1,11 @@ "Implement Idle Shell history mechanism with History class" -from idlelib.configHandler import idleConf +from idlelib.config_handler import idleConf class History: ''' Implement Idle Shell history mechanism. - store - Store source statement (called from PyShell.resetoutput). + store - Store source statement (called from pyshell.resetoutput). fetch - Fetch stored statement matching prefix already entered. history_next - Bound to <> event (default Alt-N). history_prev - Bound to <> event (default Alt-P). diff -r d9e490f72476 Lib/idlelib/idle_test/htest.py --- a/Lib/idlelib/idle_test/htest.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/htest.py Tue May 19 03:18:15 2015 -0700 @@ -59,19 +59,19 @@ Modules and classes not being tested at the moment: -PyShell.PyShellEditorWindow -Debugger.Debugger -AutoCompleteWindow.AutoCompleteWindow -OutputWindow.OutputWindow (indirectly being tested with grep test) +pyshell.PyShellEditorWindow +debugger.Debugger +autocomplete_window.AutoCompleteWindow +output_window.OutputWindow (indirectly being tested with grep test) ''' from importlib import import_module -from idlelib.macosxSupport import _initializeTkVariantTests +from idlelib.mac_osx_support import _initializeTkVariantTests import tkinter as tk AboutDialog_spec = { - 'file': 'aboutDialog', - 'kwds': {'title': 'aboutDialog test', + 'file': 'about_dialog', + 'kwds': {'title': 'about_dialog test', '_htest': True, }, 'msg': "Test every button. Ensure Python, TK and IDLE versions " @@ -79,14 +79,14 @@ } _calltip_window_spec = { - 'file': 'CallTipWindow', + 'file': 'calltip_window', 'kwds': {}, 'msg': "Typing '(' should display a calltip.\n" "Typing ') should hide the calltip.\n" } _class_browser_spec = { - 'file': 'ClassBrowser', + 'file': 'class_browser', 'kwds': {}, 'msg': "Inspect names of module, class(with superclass if " "applicable), methods and functions.\nToggle nested items.\n" @@ -94,7 +94,7 @@ "that is ignored." } ConfigExtensionsDialog_spec = { - 'file': 'configDialog', + 'file': 'config_dialog', 'kwds': {'title': 'Test Extension Configuration', '_htest': True,}, 'msg': "IDLE extensions dialog.\n" @@ -104,7 +104,7 @@ } _color_delegator_spec = { - 'file': 'ColorDelegator', + 'file': 'color_delegator', 'kwds': {}, 'msg': "The text is sample Python code.\n" "Ensure components like comments, keywords, builtins,\n" @@ -113,7 +113,7 @@ } ConfigDialog_spec = { - 'file': 'configDialog', + 'file': 'config_dialog', 'kwds': {'title': 'ConfigDialogTest', '_htest': True,}, 'msg': "IDLE preferences dialog.\n" @@ -129,7 +129,7 @@ # TODO Improve message _dyn_option_menu_spec = { - 'file': 'dynOptionMenuWidget', + 'file': 'dyn_option_menu_widget', 'kwds': {}, 'msg': "Select one of the many options in the 'old option set'.\n" "Click the button to change the option set.\n" @@ -138,14 +138,14 @@ # TODO edit wrapper _editor_window_spec = { - 'file': 'EditorWindow', + 'file': 'editor_window', 'kwds': {}, 'msg': "Test editor functions of interest.\n" "Best to close editor first." } GetCfgSectionNameDialog_spec = { - 'file': 'configSectionNameDialog', + 'file': 'config_section_name_dialog', 'kwds': {'title':'Get Name', 'message':'Enter something', 'used_names': {'abc'}, @@ -157,7 +157,7 @@ } GetHelpSourceDialog_spec = { - 'file': 'configHelpSourceEdit', + 'file': 'config_help_source_edit', 'kwds': {'title': 'Get helpsource', '_htest': True}, 'msg': "Enter menu item name and help file path\n " @@ -170,7 +170,7 @@ # Update once issue21519 is resolved. GetKeysDialog_spec = { - 'file': 'keybindingDialog', + 'file': 'keybinding_dialog', 'kwds': {'title': 'Test keybindings', 'action': 'find-again', 'currentKeySequences': [''] , @@ -185,7 +185,7 @@ } _grep_dialog_spec = { - 'file': 'GrepDialog', + 'file': 'grep_dialog', 'kwds': {}, 'msg': "Click the 'Show GrepDialog' button.\n" "Test the various 'Find-in-files' functions.\n" @@ -195,14 +195,14 @@ } _help_dialog_spec = { - 'file': 'EditorWindow', + 'file': 'editor_window', 'kwds': {}, 'msg': "If the help text displays, this works.\n" "Text is selectable. Window is scrollable." } _io_binding_spec = { - 'file': 'IOBinding', + 'file': 'io_binding', 'kwds': {}, 'msg': "Test the following bindings\n" " to display open window from file dialog.\n" @@ -210,7 +210,7 @@ } _multi_call_spec = { - 'file': 'MultiCall', + 'file': 'multi_call', 'kwds': {}, 'msg': "The following actions should trigger a print to console or IDLE" " Shell.\nEntering and leaving the text area, key entry, " @@ -220,14 +220,14 @@ } _multistatus_bar_spec = { - 'file': 'MultiStatusBar', + 'file': 'multi_status_bar', 'kwds': {}, 'msg': "Ensure presence of multi-status bar below text area.\n" "Click 'Update Status' to change the multi-status text" } _object_browser_spec = { - 'file': 'ObjectBrowser', + 'file': 'object_browser', 'kwds': {}, 'msg': "Double click on items upto the lowest level.\n" "Attributes of the objects and related information " @@ -235,7 +235,7 @@ } _path_browser_spec = { - 'file': 'PathBrowser', + 'file': 'path_browser', 'kwds': {}, 'msg': "Test for correct display of all paths in sys.path.\n" "Toggle nested items upto the lowest level.\n" @@ -244,7 +244,7 @@ } _percolator_spec = { - 'file': 'Percolator', + 'file': 'percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" "Toggling a tracer 'on' by checking it should print tracer" @@ -255,7 +255,7 @@ } _replace_dialog_spec = { - 'file': 'ReplaceDialog', + 'file': 'replace_dialog', 'kwds': {}, 'msg': "Click the 'Replace' button.\n" "Test various replace options in the 'Replace dialog'.\n" @@ -263,7 +263,7 @@ } _search_dialog_spec = { - 'file': 'SearchDialog', + 'file': 'search_dialog', 'kwds': {}, 'msg': "Click the 'Search' button.\n" "Test various search options in the 'Search dialog'.\n" @@ -271,7 +271,7 @@ } _scrolled_list_spec = { - 'file': 'ScrolledList', + 'file': 'scrolled_list', 'kwds': {}, 'msg': "You should see a scrollable list of items\n" "Selecting (clicking) or double clicking an item " @@ -280,7 +280,7 @@ } _stack_viewer_spec = { - 'file': 'StackViewer', + 'file': 'stack_viewer', 'kwds': {}, 'msg': "A stacktrace for a NameError exception.\n" "Expand 'idlelib ...' and ''.\n" @@ -288,7 +288,7 @@ } _tabbed_pages_spec = { - 'file': 'tabbedpages', + 'file': 'tabbed_pages', 'kwds': {}, 'msg': "Toggle between the two tabs 'foo' and 'bar'\n" "Add a tab by entering a suitable name for it.\n" @@ -298,8 +298,8 @@ } TextViewer_spec = { - 'file': 'textView', - 'kwds': {'title': 'Test textView', + 'file': 'text_view', + 'kwds': {'title': 'Test text_view', 'text':'The quick brown fox jumps over the lazy dog.\n'*35, '_htest': True}, 'msg': "Test for read-only property of text.\n" @@ -307,21 +307,21 @@ } _tooltip_spec = { - 'file': 'ToolTip', + 'file': 'tool_tip', 'kwds': {}, 'msg': "Place mouse cursor over both the buttons\n" "A tooltip should appear with some text." } _tree_widget_spec = { - 'file': 'TreeWidget', + 'file': 'tree_widget', 'kwds': {}, 'msg': "The canvas is scrollable.\n" "Click on folders upto to the lowest level." } _undo_delegator_spec = { - 'file': 'UndoDelegator', + 'file': 'undo_delegator', 'kwds': {}, 'msg': "Click [Undo] to undo any action.\n" "Click [Redo] to redo any action.\n" @@ -330,7 +330,7 @@ } _widget_redirector_spec = { - 'file': 'WidgetRedirector', + 'file': 'widget_redirector', 'kwds': {}, 'msg': "Every text insert should be printed to the console." "or the IDLE shell." diff -r d9e490f72476 Lib/idlelib/idle_test/mock_idle.py --- a/Lib/idlelib/idle_test/mock_idle.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/mock_idle.py Tue May 19 03:18:15 2015 -0700 @@ -33,7 +33,7 @@ class Editor: - '''Minimally imitate EditorWindow.EditorWindow class. + '''Minimally imitate editor_window.EditorWindow class. ''' def __init__(self, flist=None, filename=None, key=None, root=None): self.text = Text() @@ -46,7 +46,7 @@ class UndoDelegator: - '''Minimally imitate UndoDelegator,UndoDelegator class. + '''Minimally imitate undo_delegator.UndoDelegator class. ''' # A real undo block is only needed for user interaction. def undo_block_start(*args): diff -r d9e490f72476 Lib/idlelib/idle_test/test_autocomplete.py --- a/Lib/idlelib/idle_test/test_autocomplete.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_autocomplete.py Tue May 19 03:18:15 2015 -0700 @@ -2,9 +2,9 @@ from test.support import requires from tkinter import Tk, Text -import idlelib.AutoComplete as ac -import idlelib.AutoCompleteWindow as acw -import idlelib.macosxSupport as mac +import idlelib.autocomplete as ac +import idlelib.autocomplete_window as acw +import idlelib.mac_osx_support as mac from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Event diff -r d9e490f72476 Lib/idlelib/idle_test/test_autoexpand.py --- a/Lib/idlelib/idle_test/test_autoexpand.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_autoexpand.py Tue May 19 03:18:15 2015 -0700 @@ -1,9 +1,9 @@ -"""Unit tests for idlelib.AutoExpand""" +"""Unit tests for idlelib.autoexpand""" import unittest from test.support import requires from tkinter import Text, Tk #from idlelib.idle_test.mock_tk import Text -from idlelib.AutoExpand import AutoExpand +from idlelib.autoexpand import AutoExpand class Dummy_Editwin: diff -r d9e490f72476 Lib/idlelib/idle_test/test_calltips.py --- a/Lib/idlelib/idle_test/test_calltips.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_calltips.py Tue May 19 03:18:15 2015 -0700 @@ -1,5 +1,5 @@ import unittest -import idlelib.CallTips as ct +import idlelib.calltips as ct import textwrap import types diff -r d9e490f72476 Lib/idlelib/idle_test/test_config_dialog.py --- a/Lib/idlelib/idle_test/test_config_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_config_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -'''Unittests for idlelib/configHandler.py +'''Unittests for idlelib/config_handler.py Coverage: 46% just by creating dialog. The other half is change code. @@ -6,8 +6,8 @@ import unittest from test.support import requires from tkinter import Tk -from idlelib.configDialog import ConfigDialog -from idlelib.macosxSupport import _initializeTkVariantTests +from idlelib.config_dialog import ConfigDialog +from idlelib.mac_osx_support import _initializeTkVariantTests class ConfigDialogTest(unittest.TestCase): diff -r d9e490f72476 Lib/idlelib/idle_test/test_config_section_name_dialog.py --- a/Lib/idlelib/idle_test/test_config_section_name_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_config_section_name_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -1,7 +1,7 @@ -"""Unit tests for idlelib.configSectionNameDialog""" +"""Unit tests for idlelib.config_section_name_dialog""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox -from idlelib import configSectionNameDialog as name_dialog_module +from idlelib import config_section_name_dialog as name_dialog_module name_dialog = name_dialog_module.GetCfgSectionNameDialog diff -r d9e490f72476 Lib/idlelib/idle_test/test_delegator.py --- a/Lib/idlelib/idle_test/test_delegator.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_delegator.py Tue May 19 03:18:15 2015 -0700 @@ -1,5 +1,5 @@ import unittest -from idlelib.Delegator import Delegator +from idlelib.delegator import Delegator class DelegatorTest(unittest.TestCase): diff -r d9e490f72476 Lib/idlelib/idle_test/test_format_paragraph.py --- a/Lib/idlelib/idle_test/test_format_paragraph.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_format_paragraph.py Tue May 19 03:18:15 2015 -0700 @@ -1,7 +1,7 @@ # Test the functions and main class method of FormatParagraph.py import unittest -from idlelib import FormatParagraph as fp -from idlelib.EditorWindow import EditorWindow +from idlelib import format_paragraph as fp +from idlelib.editor_window import EditorWindow from tkinter import Tk, Text from test.support import requires diff -r d9e490f72476 Lib/idlelib/idle_test/test_grep_dialog.py --- a/Lib/idlelib/idle_test/test_grep_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_grep_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -1,5 +1,5 @@ """ !Changing this line will break Test_findfile.test_found! -Non-gui unit tests for idlelib.GrepDialog methods. +Non-gui unit tests for grep_dialog.GrepDialog methods. dummy_command calls grep_it calls findfiles. An exception raised in one method will fail callers. Otherwise, tests are mostly independent. @@ -8,7 +8,7 @@ import unittest from test.support import captured_stdout from idlelib.idle_test.mock_tk import Var -from idlelib.GrepDialog import GrepDialog +from idlelib.grep_dialog import GrepDialog import re class Dummy_searchengine: @@ -72,7 +72,7 @@ self.assertTrue(lines[4].startswith('(Hint:')) class Default_commandTest(unittest.TestCase): - # To write this, mode OutputWindow import to top of GrepDialog + # To write this, move output_window import to top of GrepDialog # so it can be replaced by captured_stdout in class setup/teardown. pass diff -r d9e490f72476 Lib/idlelib/idle_test/test_hyper_parser.py --- a/Lib/idlelib/idle_test/test_hyper_parser.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_hyper_parser.py Tue May 19 03:18:15 2015 -0700 @@ -2,8 +2,8 @@ import unittest from test.support import requires from tkinter import Tk, Text -from idlelib.EditorWindow import EditorWindow -from idlelib.HyperParser import HyperParser +from idlelib.editor_window import EditorWindow +from idlelib.hyper_parser import HyperParser class DummyEditwin: def __init__(self, text): diff -r d9e490f72476 Lib/idlelib/idle_test/test_idle_history.py --- a/Lib/idlelib/idle_test/test_idle_history.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_idle_history.py Tue May 19 03:18:15 2015 -0700 @@ -4,8 +4,8 @@ import tkinter as tk from tkinter import Text as tkText from idlelib.idle_test.mock_tk import Text as mkText -from idlelib.IdleHistory import History -from idlelib.configHandler import idleConf +from idlelib.idle_history import History +from idlelib.config_handler import idleConf line1 = 'a = 7' line2 = 'b = a' diff -r d9e490f72476 Lib/idlelib/idle_test/test_io.py --- a/Lib/idlelib/idle_test/test_io.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_io.py Tue May 19 03:18:15 2015 -0700 @@ -1,6 +1,6 @@ import unittest import io -from idlelib.PyShell import PseudoInputFile, PseudoOutputFile +from idlelib.pyshell import PseudoInputFile, PseudoOutputFile class S(str): diff -r d9e490f72476 Lib/idlelib/idle_test/test_paren_match.py --- a/Lib/idlelib/idle_test/test_paren_match.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_paren_match.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -"""Test idlelib.ParenMatch.""" +"""Test idlelib.paren_match.""" # This must currently be a gui test because ParenMatch methods use # several text methods not defined on idlelib.idle_test.mock_tk.Text. @@ -6,7 +6,7 @@ from unittest.mock import Mock from test.support import requires from tkinter import Tk, Text -from idlelib.ParenMatch import ParenMatch +from idlelib.paren_match import ParenMatch class DummyEditwin: def __init__(self, text): diff -r d9e490f72476 Lib/idlelib/idle_test/test_path_browser.py --- a/Lib/idlelib/idle_test/test_path_browser.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_path_browser.py Tue May 19 03:18:15 2015 -0700 @@ -1,5 +1,5 @@ import unittest -import idlelib.PathBrowser as PathBrowser +import idlelib.path_browser as PathBrowser class PathBrowserTest(unittest.TestCase): diff -r d9e490f72476 Lib/idlelib/idle_test/test_rstrip_extension.py --- a/Lib/idlelib/idle_test/test_rstrip_extension.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_rstrip_extension.py Tue May 19 03:18:15 2015 -0700 @@ -1,5 +1,5 @@ import unittest -import idlelib.RstripExtension as rs +import idlelib.rstrip_extension as rs from idlelib.idle_test.mock_idle import Editor class rstripTest(unittest.TestCase): @@ -21,7 +21,7 @@ def test_rstrip_multiple(self): editor = Editor() # Uncomment following to verify that test passes with real widgets. -## from idlelib.EditorWindow import EditorWindow as Editor +## from idlelib.editor_window import EditorWindow as Editor ## from tkinter import Tk ## editor = Editor(root=Tk()) text = editor.text diff -r d9e490f72476 Lib/idlelib/idle_test/test_search_dialog_base.py --- a/Lib/idlelib/idle_test/test_search_dialog_base.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_search_dialog_base.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -'''Unittests for idlelib/SearchDialogBase.py +'''Unittests for idlelib/search_dialog_base.py Coverage: 99%. The only thing not covered is inconsequential -- testing skipping of suite when self.needwrapbutton is false. @@ -7,8 +7,8 @@ import unittest from test.support import requires from tkinter import Tk, Toplevel, Frame ##, BooleanVar, StringVar -from idlelib import SearchEngine as se -from idlelib import SearchDialogBase as sdb +from idlelib import search_engine as se +from idlelib import search_dialog_base as sdb from idlelib.idle_test.mock_idle import Func ## from idlelib.idle_test.mock_tk import Var diff -r d9e490f72476 Lib/idlelib/idle_test/test_search_engine.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/idlelib/idle_test/test_search_engine.py Tue May 19 03:18:15 2015 -0700 @@ -0,0 +1,329 @@ +'''Test functions and SearchEngine class in SearchEngine.py.''' + +# With mock replacements, the module does not use any gui widgets. +# The use of tk.Text is avoided (for now, until mock Text is improved) +# by patching instances with an index function returning what is needed. +# This works because mock Text.get does not use .index. + +import re +import unittest +# from test.support import requires +from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text +import tkinter.messagebox as tkMessageBox +from idlelib import search_engine as se +from idlelib.idle_test.mock_tk import Var, Mbox +from idlelib.idle_test.mock_tk import Text as mockText + +def setUpModule(): + # Replace s-e module tkinter imports other than non-gui TclError. + se.BooleanVar = Var + se.StringVar = Var + se.tkMessageBox = Mbox + +def tearDownModule(): + # Restore 'just in case', though other tests should also replace. + se.BooleanVar = BooleanVar + se.StringVar = StringVar + se.tkMessageBox = tkMessageBox + + +class Mock: + def __init__(self, *args, **kwargs): pass + +class GetTest(unittest.TestCase): + # search_engine.get returns singleton created & saved on first call. + def test_get(self): + saved_Engine = se.SearchEngine + se.SearchEngine = Mock # monkey-patch class + try: + root = Mock() + engine = se.get(root) + self.assertIsInstance(engine, se.SearchEngine) + self.assertIs(root._searchengine, engine) + self.assertIs(se.get(root), engine) + finally: + se.SearchEngine = saved_Engine # restore class to module + +class GetLineColTest(unittest.TestCase): + # Test simple text-independent helper function + def test_get_line_col(self): + self.assertEqual(se.get_line_col('1.0'), (1, 0)) + self.assertEqual(se.get_line_col('1.11'), (1, 11)) + + self.assertRaises(ValueError, se.get_line_col, ('1.0 lineend')) + self.assertRaises(ValueError, se.get_line_col, ('end')) + +class GetSelectionTest(unittest.TestCase): + # Test text-dependent helper function. +## # Need gui for text.index('sel.first/sel.last/insert'). +## @classmethod +## def setUpClass(cls): +## requires('gui') +## cls.root = Tk() +## +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() +## del cls.root + + def test_get_selection(self): + # text = Text(master=self.root) + text = mockText() + text.insert('1.0', 'Hello World!') + + # fix text.index result when called in get_selection + def sel(s): + # select entire text, cursor irrelevant + if s == 'sel.first': return '1.0' + if s == 'sel.last': return '1.12' + raise TclError + text.index = sel # replaces .tag_add('sel', '1.0, '1.12') + self.assertEqual(se.get_selection(text), ('1.0', '1.12')) + + def mark(s): + # no selection, cursor after 'Hello' + if s == 'insert': return '1.5' + raise TclError + text.index = mark # replaces .mark_set('insert', '1.5') + self.assertEqual(se.get_selection(text), ('1.5', '1.5')) + + +class ReverseSearchTest(unittest.TestCase): + # Test helper function that searches backwards within a line. + def test_search_reverse(self): + Equal = self.assertEqual + line = "Here is an 'is' test text." + prog = re.compile('is') + Equal(se.search_reverse(prog, line, len(line)).span(), (12, 14)) + Equal(se.search_reverse(prog, line, 14).span(), (12, 14)) + Equal(se.search_reverse(prog, line, 13).span(), (5, 7)) + Equal(se.search_reverse(prog, line, 7).span(), (5, 7)) + Equal(se.search_reverse(prog, line, 6), None) + + +class SearchEngineTest(unittest.TestCase): + # Test class methods that do not use Text widget. + + def setUp(self): + self.engine = se.SearchEngine(root=None) + # Engine.root is only used to create error message boxes. + # The mock replacement ignores the root argument. + + def test_is_get(self): + engine = self.engine + Equal = self.assertEqual + + Equal(engine.getpat(), '') + engine.setpat('hello') + Equal(engine.getpat(), 'hello') + + Equal(engine.isre(), False) + engine.revar.set(1) + Equal(engine.isre(), True) + + Equal(engine.iscase(), False) + engine.casevar.set(1) + Equal(engine.iscase(), True) + + Equal(engine.isword(), False) + engine.wordvar.set(1) + Equal(engine.isword(), True) + + Equal(engine.iswrap(), True) + engine.wrapvar.set(0) + Equal(engine.iswrap(), False) + + Equal(engine.isback(), False) + engine.backvar.set(1) + Equal(engine.isback(), True) + + def test_setcookedpat(self): + engine = self.engine + engine.setcookedpat('\s') + self.assertEqual(engine.getpat(), '\s') + engine.revar.set(1) + engine.setcookedpat('\s') + self.assertEqual(engine.getpat(), r'\\s') + + def test_getcookedpat(self): + engine = self.engine + Equal = self.assertEqual + + Equal(engine.getcookedpat(), '') + engine.setpat('hello') + Equal(engine.getcookedpat(), 'hello') + engine.wordvar.set(True) + Equal(engine.getcookedpat(), r'\bhello\b') + engine.wordvar.set(False) + + engine.setpat('\s') + Equal(engine.getcookedpat(), r'\\s') + engine.revar.set(True) + Equal(engine.getcookedpat(), '\s') + + def test_getprog(self): + engine = self.engine + Equal = self.assertEqual + + engine.setpat('Hello') + temppat = engine.getprog() + Equal(temppat.pattern, re.compile('Hello', re.IGNORECASE).pattern) + engine.casevar.set(1) + temppat = engine.getprog() + Equal(temppat.pattern, re.compile('Hello').pattern, 0) + + engine.setpat('') + Equal(engine.getprog(), None) + engine.setpat('+') + engine.revar.set(1) + Equal(engine.getprog(), None) + self.assertEqual(Mbox.showerror.message, + 'Error: nothing to repeat at position 0\nPattern: +') + + def test_report_error(self): + showerror = Mbox.showerror + Equal = self.assertEqual + pat = '[a-z' + msg = 'unexpected end of regular expression' + + Equal(self.engine.report_error(pat, msg), None) + Equal(showerror.title, 'Regular expression error') + expected_message = ("Error: " + msg + "\nPattern: [a-z") + Equal(showerror.message, expected_message) + + Equal(self.engine.report_error(pat, msg, 5), None) + Equal(showerror.title, 'Regular expression error') + expected_message += "\nOffset: 5" + Equal(showerror.message, expected_message) + + +class SearchTest(unittest.TestCase): + # Test that search_text makes right call to right method. + + @classmethod + def setUpClass(cls): +## requires('gui') +## cls.root = Tk() +## cls.text = Text(master=cls.root) + cls.text = mockText() + test_text = ( + 'First line\n' + 'Line with target\n' + 'Last line\n') + cls.text.insert('1.0', test_text) + cls.pat = re.compile('target') + + cls.engine = se.SearchEngine(None) + cls.engine.search_forward = lambda *args: ('f', args) + cls.engine.search_backward = lambda *args: ('b', args) + +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() +## del cls.root + + def test_search(self): + Equal = self.assertEqual + engine = self.engine + search = engine.search_text + text = self.text + pat = self.pat + + engine.patvar.set(None) + #engine.revar.set(pat) + Equal(search(text), None) + + def mark(s): + # no selection, cursor after 'Hello' + if s == 'insert': return '1.5' + raise TclError + text.index = mark + Equal(search(text, pat), ('f', (text, pat, 1, 5, True, False))) + engine.wrapvar.set(False) + Equal(search(text, pat), ('f', (text, pat, 1, 5, False, False))) + engine.wrapvar.set(True) + engine.backvar.set(True) + Equal(search(text, pat), ('b', (text, pat, 1, 5, True, False))) + engine.backvar.set(False) + + def sel(s): + if s == 'sel.first': return '2.10' + if s == 'sel.last': return '2.16' + raise TclError + text.index = sel + Equal(search(text, pat), ('f', (text, pat, 2, 16, True, False))) + Equal(search(text, pat, True), ('f', (text, pat, 2, 10, True, True))) + engine.backvar.set(True) + Equal(search(text, pat), ('b', (text, pat, 2, 10, True, False))) + Equal(search(text, pat, True), ('b', (text, pat, 2, 16, True, True))) + + +class ForwardBackwardTest(unittest.TestCase): + # Test that search_forward method finds the target. +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() +## del cls.root + + @classmethod + def setUpClass(cls): + cls.engine = se.SearchEngine(None) +## requires('gui') +## cls.root = Tk() +## cls.text = Text(master=cls.root) + cls.text = mockText() + # search_backward calls index('end-1c') + cls.text.index = lambda index: '4.0' + test_text = ( + 'First line\n' + 'Line with target\n' + 'Last line\n') + cls.text.insert('1.0', test_text) + cls.pat = re.compile('target') + cls.res = (2, (10, 16)) # line, slice indexes of 'target' + cls.failpat = re.compile('xyz') # not in text + cls.emptypat = re.compile('\w*') # empty match possible + + def make_search(self, func): + def search(pat, line, col, wrap, ok=0): + res = func(self.text, pat, line, col, wrap, ok) + # res is (line, matchobject) or None + return (res[0], res[1].span()) if res else res + return search + + def test_search_forward(self): + # search for non-empty match + Equal = self.assertEqual + forward = self.make_search(self.engine.search_forward) + pat = self.pat + Equal(forward(pat, 1, 0, True), self.res) + Equal(forward(pat, 3, 0, True), self.res) # wrap + Equal(forward(pat, 3, 0, False), None) # no wrap + Equal(forward(pat, 2, 10, False), self.res) + + Equal(forward(self.failpat, 1, 0, True), None) + Equal(forward(self.emptypat, 2, 9, True, ok=True), (2, (9, 9))) + #Equal(forward(self.emptypat, 2, 9, True), self.res) + # While the initial empty match is correctly ignored, skipping + # the rest of the line and returning (3, (0,4)) seems buggy - tjr. + Equal(forward(self.emptypat, 2, 10, True), self.res) + + def test_search_backward(self): + # search for non-empty match + Equal = self.assertEqual + backward = self.make_search(self.engine.search_backward) + pat = self.pat + Equal(backward(pat, 3, 5, True), self.res) + Equal(backward(pat, 2, 0, True), self.res) # wrap + Equal(backward(pat, 2, 0, False), None) # no wrap + Equal(backward(pat, 2, 16, False), self.res) + + Equal(backward(self.failpat, 3, 9, True), None) + Equal(backward(self.emptypat, 2, 10, True, ok=True), (2, (9,9))) + # Accepted because 9 < 10, not because ok=True. + # It is not clear that ok=True is useful going back - tjr + Equal(backward(self.emptypat, 2, 9, True), (2, (5, 9))) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=2) diff -r d9e490f72476 Lib/idlelib/idle_test/test_search_enigne.py --- a/Lib/idlelib/idle_test/test_search_enigne.py Mon May 18 15:05:43 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,329 +0,0 @@ -'''Test functions and SearchEngine class in SearchEngine.py.''' - -# With mock replacements, the module does not use any gui widgets. -# The use of tk.Text is avoided (for now, until mock Text is improved) -# by patching instances with an index function returning what is needed. -# This works because mock Text.get does not use .index. - -import re -import unittest -# from test.support import requires -from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text -import tkinter.messagebox as tkMessageBox -from idlelib import SearchEngine as se -from idlelib.idle_test.mock_tk import Var, Mbox -from idlelib.idle_test.mock_tk import Text as mockText - -def setUpModule(): - # Replace s-e module tkinter imports other than non-gui TclError. - se.BooleanVar = Var - se.StringVar = Var - se.tkMessageBox = Mbox - -def tearDownModule(): - # Restore 'just in case', though other tests should also replace. - se.BooleanVar = BooleanVar - se.StringVar = StringVar - se.tkMessageBox = tkMessageBox - - -class Mock: - def __init__(self, *args, **kwargs): pass - -class GetTest(unittest.TestCase): - # SearchEngine.get returns singleton created & saved on first call. - def test_get(self): - saved_Engine = se.SearchEngine - se.SearchEngine = Mock # monkey-patch class - try: - root = Mock() - engine = se.get(root) - self.assertIsInstance(engine, se.SearchEngine) - self.assertIs(root._searchengine, engine) - self.assertIs(se.get(root), engine) - finally: - se.SearchEngine = saved_Engine # restore class to module - -class GetLineColTest(unittest.TestCase): - # Test simple text-independent helper function - def test_get_line_col(self): - self.assertEqual(se.get_line_col('1.0'), (1, 0)) - self.assertEqual(se.get_line_col('1.11'), (1, 11)) - - self.assertRaises(ValueError, se.get_line_col, ('1.0 lineend')) - self.assertRaises(ValueError, se.get_line_col, ('end')) - -class GetSelectionTest(unittest.TestCase): - # Test text-dependent helper function. -## # Need gui for text.index('sel.first/sel.last/insert'). -## @classmethod -## def setUpClass(cls): -## requires('gui') -## cls.root = Tk() -## -## @classmethod -## def tearDownClass(cls): -## cls.root.destroy() -## del cls.root - - def test_get_selection(self): - # text = Text(master=self.root) - text = mockText() - text.insert('1.0', 'Hello World!') - - # fix text.index result when called in get_selection - def sel(s): - # select entire text, cursor irrelevant - if s == 'sel.first': return '1.0' - if s == 'sel.last': return '1.12' - raise TclError - text.index = sel # replaces .tag_add('sel', '1.0, '1.12') - self.assertEqual(se.get_selection(text), ('1.0', '1.12')) - - def mark(s): - # no selection, cursor after 'Hello' - if s == 'insert': return '1.5' - raise TclError - text.index = mark # replaces .mark_set('insert', '1.5') - self.assertEqual(se.get_selection(text), ('1.5', '1.5')) - - -class ReverseSearchTest(unittest.TestCase): - # Test helper function that searches backwards within a line. - def test_search_reverse(self): - Equal = self.assertEqual - line = "Here is an 'is' test text." - prog = re.compile('is') - Equal(se.search_reverse(prog, line, len(line)).span(), (12, 14)) - Equal(se.search_reverse(prog, line, 14).span(), (12, 14)) - Equal(se.search_reverse(prog, line, 13).span(), (5, 7)) - Equal(se.search_reverse(prog, line, 7).span(), (5, 7)) - Equal(se.search_reverse(prog, line, 6), None) - - -class SearchEngineTest(unittest.TestCase): - # Test class methods that do not use Text widget. - - def setUp(self): - self.engine = se.SearchEngine(root=None) - # Engine.root is only used to create error message boxes. - # The mock replacement ignores the root argument. - - def test_is_get(self): - engine = self.engine - Equal = self.assertEqual - - Equal(engine.getpat(), '') - engine.setpat('hello') - Equal(engine.getpat(), 'hello') - - Equal(engine.isre(), False) - engine.revar.set(1) - Equal(engine.isre(), True) - - Equal(engine.iscase(), False) - engine.casevar.set(1) - Equal(engine.iscase(), True) - - Equal(engine.isword(), False) - engine.wordvar.set(1) - Equal(engine.isword(), True) - - Equal(engine.iswrap(), True) - engine.wrapvar.set(0) - Equal(engine.iswrap(), False) - - Equal(engine.isback(), False) - engine.backvar.set(1) - Equal(engine.isback(), True) - - def test_setcookedpat(self): - engine = self.engine - engine.setcookedpat('\s') - self.assertEqual(engine.getpat(), '\s') - engine.revar.set(1) - engine.setcookedpat('\s') - self.assertEqual(engine.getpat(), r'\\s') - - def test_getcookedpat(self): - engine = self.engine - Equal = self.assertEqual - - Equal(engine.getcookedpat(), '') - engine.setpat('hello') - Equal(engine.getcookedpat(), 'hello') - engine.wordvar.set(True) - Equal(engine.getcookedpat(), r'\bhello\b') - engine.wordvar.set(False) - - engine.setpat('\s') - Equal(engine.getcookedpat(), r'\\s') - engine.revar.set(True) - Equal(engine.getcookedpat(), '\s') - - def test_getprog(self): - engine = self.engine - Equal = self.assertEqual - - engine.setpat('Hello') - temppat = engine.getprog() - Equal(temppat.pattern, re.compile('Hello', re.IGNORECASE).pattern) - engine.casevar.set(1) - temppat = engine.getprog() - Equal(temppat.pattern, re.compile('Hello').pattern, 0) - - engine.setpat('') - Equal(engine.getprog(), None) - engine.setpat('+') - engine.revar.set(1) - Equal(engine.getprog(), None) - self.assertEqual(Mbox.showerror.message, - 'Error: nothing to repeat at position 0\nPattern: +') - - def test_report_error(self): - showerror = Mbox.showerror - Equal = self.assertEqual - pat = '[a-z' - msg = 'unexpected end of regular expression' - - Equal(self.engine.report_error(pat, msg), None) - Equal(showerror.title, 'Regular expression error') - expected_message = ("Error: " + msg + "\nPattern: [a-z") - Equal(showerror.message, expected_message) - - Equal(self.engine.report_error(pat, msg, 5), None) - Equal(showerror.title, 'Regular expression error') - expected_message += "\nOffset: 5" - Equal(showerror.message, expected_message) - - -class SearchTest(unittest.TestCase): - # Test that search_text makes right call to right method. - - @classmethod - def setUpClass(cls): -## requires('gui') -## cls.root = Tk() -## cls.text = Text(master=cls.root) - cls.text = mockText() - test_text = ( - 'First line\n' - 'Line with target\n' - 'Last line\n') - cls.text.insert('1.0', test_text) - cls.pat = re.compile('target') - - cls.engine = se.SearchEngine(None) - cls.engine.search_forward = lambda *args: ('f', args) - cls.engine.search_backward = lambda *args: ('b', args) - -## @classmethod -## def tearDownClass(cls): -## cls.root.destroy() -## del cls.root - - def test_search(self): - Equal = self.assertEqual - engine = self.engine - search = engine.search_text - text = self.text - pat = self.pat - - engine.patvar.set(None) - #engine.revar.set(pat) - Equal(search(text), None) - - def mark(s): - # no selection, cursor after 'Hello' - if s == 'insert': return '1.5' - raise TclError - text.index = mark - Equal(search(text, pat), ('f', (text, pat, 1, 5, True, False))) - engine.wrapvar.set(False) - Equal(search(text, pat), ('f', (text, pat, 1, 5, False, False))) - engine.wrapvar.set(True) - engine.backvar.set(True) - Equal(search(text, pat), ('b', (text, pat, 1, 5, True, False))) - engine.backvar.set(False) - - def sel(s): - if s == 'sel.first': return '2.10' - if s == 'sel.last': return '2.16' - raise TclError - text.index = sel - Equal(search(text, pat), ('f', (text, pat, 2, 16, True, False))) - Equal(search(text, pat, True), ('f', (text, pat, 2, 10, True, True))) - engine.backvar.set(True) - Equal(search(text, pat), ('b', (text, pat, 2, 10, True, False))) - Equal(search(text, pat, True), ('b', (text, pat, 2, 16, True, True))) - - -class ForwardBackwardTest(unittest.TestCase): - # Test that search_forward method finds the target. -## @classmethod -## def tearDownClass(cls): -## cls.root.destroy() -## del cls.root - - @classmethod - def setUpClass(cls): - cls.engine = se.SearchEngine(None) -## requires('gui') -## cls.root = Tk() -## cls.text = Text(master=cls.root) - cls.text = mockText() - # search_backward calls index('end-1c') - cls.text.index = lambda index: '4.0' - test_text = ( - 'First line\n' - 'Line with target\n' - 'Last line\n') - cls.text.insert('1.0', test_text) - cls.pat = re.compile('target') - cls.res = (2, (10, 16)) # line, slice indexes of 'target' - cls.failpat = re.compile('xyz') # not in text - cls.emptypat = re.compile('\w*') # empty match possible - - def make_search(self, func): - def search(pat, line, col, wrap, ok=0): - res = func(self.text, pat, line, col, wrap, ok) - # res is (line, matchobject) or None - return (res[0], res[1].span()) if res else res - return search - - def test_search_forward(self): - # search for non-empty match - Equal = self.assertEqual - forward = self.make_search(self.engine.search_forward) - pat = self.pat - Equal(forward(pat, 1, 0, True), self.res) - Equal(forward(pat, 3, 0, True), self.res) # wrap - Equal(forward(pat, 3, 0, False), None) # no wrap - Equal(forward(pat, 2, 10, False), self.res) - - Equal(forward(self.failpat, 1, 0, True), None) - Equal(forward(self.emptypat, 2, 9, True, ok=True), (2, (9, 9))) - #Equal(forward(self.emptypat, 2, 9, True), self.res) - # While the initial empty match is correctly ignored, skipping - # the rest of the line and returning (3, (0,4)) seems buggy - tjr. - Equal(forward(self.emptypat, 2, 10, True), self.res) - - def test_search_backward(self): - # search for non-empty match - Equal = self.assertEqual - backward = self.make_search(self.engine.search_backward) - pat = self.pat - Equal(backward(pat, 3, 5, True), self.res) - Equal(backward(pat, 2, 0, True), self.res) # wrap - Equal(backward(pat, 2, 0, False), None) # no wrap - Equal(backward(pat, 2, 16, False), self.res) - - Equal(backward(self.failpat, 3, 9, True), None) - Equal(backward(self.emptypat, 2, 10, True, ok=True), (2, (9,9))) - # Accepted because 9 < 10, not because ok=True. - # It is not clear that ok=True is useful going back - tjr - Equal(backward(self.emptypat, 2, 9, True), (2, (5, 9))) - - -if __name__ == '__main__': - unittest.main(verbosity=2, exit=2) diff -r d9e490f72476 Lib/idlelib/idle_test/test_text_view.py --- a/Lib/idlelib/idle_test/test_text_view.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_text_view.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -'''Test the functions and main class method of textView.py. +'''Test the functions and main class method of text_view.py. Since all methods and functions create (or destroy) a TextViewer, which is a widget containing multiple widgets, all tests must be gui tests. @@ -13,7 +13,7 @@ import unittest import os from tkinter import Tk -from idlelib import textView as tv +from idlelib import text_view as tv from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Mbox @@ -81,7 +81,7 @@ def test_view_file(self): test_dir = os.path.dirname(__file__) - testfile = os.path.join(test_dir, 'test_textview.py') + testfile = os.path.join(test_dir, 'test_text_view.py') view = tv.view_file(root, 'Title', testfile, modal=False) self.assertIsInstance(view, tv.TextViewer) self.assertIn('Test', view.textView.get('1.0', '1.end')) diff -r d9e490f72476 Lib/idlelib/idle_test/test_warning.py --- a/Lib/idlelib/idle_test/test_warning.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_warning.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -'''Test warnings replacement in PyShell.py and run.py. +'''Test warnings replacement in pyshell.py and run.py. This file could be expanded to include traceback overrides (in same two modules). If so, change name. @@ -17,9 +17,9 @@ running_in_idle = 'idle' in showwarning.__name__ from idlelib import run -from idlelib import PyShell as shell +from idlelib import pyshell as shell -# The following was generated from PyShell.idle_formatwarning +# The following was generated from pyshell.idle_formatwarning # and checked as matching expectation. idlemsg = ''' Warning (from warnings module): diff -r d9e490f72476 Lib/idlelib/idle_test/test_widget_redirector.py --- a/Lib/idlelib/idle_test/test_widget_redirector.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/idle_test/test_widget_redirector.py Tue May 19 03:18:15 2015 -0700 @@ -1,4 +1,4 @@ -"""Unittest for idlelib.WidgetRedirector +"""Unittest for idlelib.widget_redirector 100% coverage """ @@ -6,7 +6,7 @@ import unittest from idlelib.idle_test.mock_idle import Func from tkinter import Tk, Text, TclError -from idlelib.WidgetRedirector import WidgetRedirector +from idlelib.widget_redirector import WidgetRedirector class InitCloseTest(unittest.TestCase): diff -r d9e490f72476 Lib/idlelib/io_binding.py --- a/Lib/idlelib/io_binding.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/io_binding.py Tue May 19 03:18:15 2015 -0700 @@ -9,7 +9,7 @@ from tkinter import * from tkinter.simpledialog import askstring -from idlelib.configHandler import idleConf +from idlelib.config_handler import idleConf from codecs import BOM_UTF8 diff -r d9e490f72476 Lib/idlelib/mac_osx_support.py --- a/Lib/idlelib/mac_osx_support.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/mac_osx_support.py Tue May 19 03:18:15 2015 -0700 @@ -124,23 +124,23 @@ # Due to a (mis-)feature of TkAqua the user will also see an empty Help # menu. from tkinter import Menu - from idlelib import Bindings - from idlelib import WindowList + from idlelib import bindings + from idlelib import window_list - closeItem = Bindings.menudefs[0][1][-2] + closeItem = bindings.menudefs[0][1][-2] # Remove the last 3 items of the file menu: a separator, close window and # quit. Close window will be reinserted just above the save item, where # it should be according to the HIG. Quit is in the application menu. - del Bindings.menudefs[0][1][-3:] - Bindings.menudefs[0][1].insert(6, closeItem) + del bindings.menudefs[0][1][-3:] + bindings.menudefs[0][1].insert(6, closeItem) # Remove the 'About' entry from the help menu, it is in the application # menu - del Bindings.menudefs[-1][1][0:2] + del bindings.menudefs[-1][1][0:2] # Remove the 'Configure Idle' entry from the options menu, it is in the # application menu as 'Preferences' - del Bindings.menudefs[-2][1][0] + del bindings.menudefs[-2][1][0] menubar = Menu(root) root.configure(menu=menubar) menudict = {} @@ -155,15 +155,15 @@ if end > 0: menu.delete(0, end) - WindowList.add_windows_to_menu(menu) - WindowList.register_callback(postwindowsmenu) + window_list.add_windows_to_menu(menu) + window_list.register_callback(postwindowsmenu) def about_dialog(event=None): - from idlelib import aboutDialog - aboutDialog.AboutDialog(root, 'About IDLE') + from idlelib import about_dialog + about_dialog.AboutDialog(root, 'About IDLE') def config_dialog(event=None): - from idlelib import configDialog + from idlelib import config_dialog # Ensure that the root object has an instance_dict attribute, # mirrors code in EditorWindow (although that sets the attribute @@ -171,12 +171,12 @@ # argument to ConfigDialog) root.instance_dict = flist.inversedict root.instance_dict = flist.inversedict - configDialog.ConfigDialog(root, 'Settings') + config_dialog.ConfigDialog(root, 'Settings') def help_dialog(event=None): - from idlelib import textView + from idlelib import text_view fn = path.join(path.abspath(path.dirname(__file__)), 'help.txt') - textView.view_file(root, 'Help', fn) + text_view.view_file(root, 'Help', fn) root.bind('<>', about_dialog) root.bind('<>', config_dialog) @@ -193,7 +193,7 @@ # for Carbon AquaTk, replace the default Tk apple menu menudict['application'] = menu = Menu(menubar, name='apple') menubar.add_cascade(label='IDLE', menu=menu) - Bindings.menudefs.insert(0, + bindings.menudefs.insert(0, ('application', [ ('About IDLE', '<>'), None, @@ -201,7 +201,7 @@ tkversion = root.tk.eval('info patchlevel') if tuple(map(int, tkversion.split('.'))) < (8, 4, 14): # for earlier AquaTk versions, supply a Preferences menu item - Bindings.menudefs[0][1].append( + bindings.menudefs[0][1].append( ('_Preferences....', '<>'), ) if isCocoaTk(): @@ -210,12 +210,12 @@ # replace default "Help" item in Help menu root.createcommand('::tk::mac::ShowHelp', help_dialog) # remove redundant "IDLE Help" from menu - del Bindings.menudefs[-1][1][0] + del bindings.menudefs[-1][1][0] def setupApp(root, flist): """ Perform initial OS X customizations if needed. - Called from PyShell.main() after initial calls to Tk() + Called from pyshell.main() after initial calls to Tk() There are currently three major versions of Tk in use on OS X: 1. Aqua Cocoa Tk (native default since OS X 10.6) diff -r d9e490f72476 Lib/idlelib/object_browser.py --- a/Lib/idlelib/object_browser.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/object_browser.py Tue May 19 03:18:15 2015 -0700 @@ -11,7 +11,7 @@ import re -from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas +from idlelib.tree_widget import TreeItem, TreeNode, ScrolledCanvas from reprlib import Repr diff -r d9e490f72476 Lib/idlelib/output_window.py --- a/Lib/idlelib/output_window.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/output_window.py Tue May 19 03:18:15 2015 -0700 @@ -1,8 +1,8 @@ from tkinter import * -from idlelib.EditorWindow import EditorWindow +from idlelib.editor_window import EditorWindow import re import tkinter.messagebox as tkMessageBox -from idlelib import IOBinding +from idlelib import io_binding class OutputWindow(EditorWindow): @@ -36,7 +36,7 @@ def write(self, s, tags=(), mark="insert"): if isinstance(s, (bytes, bytes)): - s = s.decode(IOBinding.encoding, "replace") + s = s.decode(io_binding.encoding, "replace") self.text.insert(mark, s, tags) self.text.see(mark) self.text.update() diff -r d9e490f72476 Lib/idlelib/paren_match.py --- a/Lib/idlelib/paren_match.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/paren_match.py Tue May 19 03:18:15 2015 -0700 @@ -5,8 +5,8 @@ parentheses, square brackets, and curly braces. """ -from idlelib.HyperParser import HyperParser -from idlelib.configHandler import idleConf +from idlelib.hyper_parser import HyperParser +from idlelib.config_handler import idleConf _openers = {')':'(',']':'[','}':'{'} CHECK_DELAY = 100 # miliseconds diff -r d9e490f72476 Lib/idlelib/path_browser.py --- a/Lib/idlelib/path_browser.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/path_browser.py Tue May 19 03:18:15 2015 -0700 @@ -2,9 +2,9 @@ import sys import importlib.machinery -from idlelib.TreeWidget import TreeItem -from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem -from idlelib.PyShell import PyShellFileList +from idlelib.tree_widget import TreeItem +from idlelib.class_browser import ClassBrowser, ModuleBrowserTreeItem +from idlelib.pyshell import PyShellFileList class PathBrowser(ClassBrowser): diff -r d9e490f72476 Lib/idlelib/percolator.py --- a/Lib/idlelib/percolator.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/percolator.py Tue May 19 03:18:15 2015 -0700 @@ -1,5 +1,5 @@ -from idlelib.WidgetRedirector import WidgetRedirector -from idlelib.Delegator import Delegator +from idlelib.widget_redirector import WidgetRedirector +from idlelib.delegator import Delegator class Percolator: diff -r d9e490f72476 Lib/idlelib/pyshell.py --- a/Lib/idlelib/pyshell.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/pyshell.py Tue May 19 03:18:15 2015 -0700 @@ -24,16 +24,16 @@ sys.exit(1) import tkinter.messagebox as tkMessageBox -from idlelib.EditorWindow import EditorWindow, fixwordbreaks -from idlelib.FileList import FileList -from idlelib.ColorDelegator import ColorDelegator -from idlelib.UndoDelegator import UndoDelegator -from idlelib.OutputWindow import OutputWindow -from idlelib.configHandler import idleConf +from idlelib.editor_window import EditorWindow, fixwordbreaks +from idlelib.file_list import FileList +from idlelib.color_delegator import ColorDelegator +from idlelib.undo_delegator import UndoDelegator +from idlelib.output_window import OutputWindow +from idlelib.config_handler import idleConf from idlelib import rpc -from idlelib import Debugger -from idlelib import RemoteDebugger -from idlelib import macosxSupport +from idlelib import debugger +from idlelib import remote_debugger +from idlelib import mac_osx_support HOST = '127.0.0.1' # python execution server on localhost loopback PORT = 0 # someday pass in host, port for remote debug capability @@ -410,7 +410,7 @@ # run from the IDLE source directory. del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc', default=False, type='bool') - if __name__ == 'idlelib.PyShell': + if __name__ == 'idlelib.pyshell': command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,) else: command = "__import__('run').main(%r)" % (del_exitf,) @@ -468,7 +468,7 @@ if debug: try: # Only close subprocess debugger, don't unregister gui_adap! - RemoteDebugger.close_subprocess_debugger(self.rpcclt) + remote_debugger.close_subprocess_debugger(self.rpcclt) except: pass # Kill subprocess, spawn a new one, accept connection. @@ -498,7 +498,7 @@ # restart subprocess debugger if debug: # Restarted debugger connects to current instance of debug GUI - RemoteDebugger.restart_subprocess_debugger(self.rpcclt) + remote_debugger.restart_subprocess_debugger(self.rpcclt) # reload remote debugger breakpoints for all PyShellEditWindows debug.load_breakpoints() self.compile.compiler.flags = self.original_compiler_flags @@ -579,7 +579,7 @@ if self.tkconsole.getvar("<>"): self.remote_stack_viewer() elif how == "ERROR": - errmsg = "PyShell.ModifiedInterpreter: Subprocess ERROR:\n" + errmsg = "pyshell.ModifiedInterpreter: Subprocess ERROR:\n" print(errmsg, what, file=sys.__stderr__) print(errmsg, what, file=console) # we received a response to the currently active seq number: @@ -614,13 +614,13 @@ return def remote_stack_viewer(self): - from idlelib import RemoteObjectBrowser + from idlelib import remote_object_browser oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {}) if oid is None: self.tkconsole.root.bell() return - item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid) - from idlelib.TreeWidget import ScrolledCanvas, TreeNode + item = remote_object_browser.StubObjectTreeItem(self.rpcclt, oid) + from idlelib.tree_widget import ScrolledCanvas, TreeNode top = Toplevel(self.tkconsole.root) theme = idleConf.GetOption('main','Theme','name') background = idleConf.GetHighlight(theme, 'normal')['background'] @@ -663,9 +663,9 @@ # at the moment, InteractiveInterpreter expects str assert isinstance(source, str) #if isinstance(source, str): - # from idlelib import IOBinding + # from idlelib import io_binding # try: - # source = source.encode(IOBinding.encoding) + # source = source.encode(io_binding.encoding) # except UnicodeError: # self.tkconsole.resetoutput() # self.write("Unsupported characters in input\n") @@ -851,7 +851,7 @@ # New classes - from idlelib.IdleHistory import History + from idlelib.idle_history import History def __init__(self, flist=None): if use_subprocess: @@ -889,11 +889,11 @@ self.save_stdout = sys.stdout self.save_stderr = sys.stderr self.save_stdin = sys.stdin - from idlelib import IOBinding - self.stdin = PseudoInputFile(self, "stdin", IOBinding.encoding) - self.stdout = PseudoOutputFile(self, "stdout", IOBinding.encoding) - self.stderr = PseudoOutputFile(self, "stderr", IOBinding.encoding) - self.console = PseudoOutputFile(self, "console", IOBinding.encoding) + from idlelib import io_binding + self.stdin = PseudoInputFile(self, "stdin", io_binding.encoding) + self.stdout = PseudoOutputFile(self, "stdout", io_binding.encoding) + self.stderr = PseudoOutputFile(self, "stderr", io_binding.encoding) + self.console = PseudoOutputFile(self, "console", io_binding.encoding) if not use_subprocess: sys.stdout = self.stdout sys.stderr = self.stderr @@ -901,7 +901,7 @@ try: # page help() text to shell. import pydoc # import must be done here to capture i/o rebinding. - # XXX KBK 27Dec07 use a textView someday, but must work w/o subproc + # XXX KBK 27Dec07 use a text_view someday, but must work w/o subproc pydoc.pager = pydoc.plainpager except: sys.stderr = sys.__stderr__ @@ -955,7 +955,7 @@ self.interp.setdebugger(None) db.close() if self.interp.rpcclt: - RemoteDebugger.close_remote_debugger(self.interp.rpcclt) + remote_debugger.close_remote_debugger(self.interp.rpcclt) self.resetoutput() self.console.write("[DEBUG OFF]\n") sys.ps1 = ">>> " @@ -964,10 +964,10 @@ def open_debugger(self): if self.interp.rpcclt: - dbg_gui = RemoteDebugger.start_remote_debugger(self.interp.rpcclt, + dbg_gui = remote_debugger.start_remote_debugger(self.interp.rpcclt, self) else: - dbg_gui = Debugger.Debugger(self) + dbg_gui = debugger.Debugger(self) self.interp.setdebugger(dbg_gui) dbg_gui.load_breakpoints() sys.ps1 = "[DEBUG ON]\n>>> " @@ -1241,7 +1241,7 @@ "(sys.last_traceback is not defined)", master=self.text) return - from idlelib.StackViewer import StackBrowser + from idlelib.stack_viewer import StackBrowser StackBrowser(self.root, self.flist) def view_restart_mark(self, event=None): @@ -1546,7 +1546,7 @@ fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) - macosxSupport.setupApp(root, flist) + mac_osx_support.setupApp(root, flist) if enable_edit: if not (cmd or script): @@ -1561,7 +1561,7 @@ shell = flist.open_shell() if not shell: return # couldn't open shell - if macosxSupport.isAquaTk() and flist.dict: + if mac_osx_support.isAquaTk() and flist.dict: # On OSX: when the user has double-clicked on a file that causes # IDLE to be launched the shell window will open just in front of # the file she wants to see. Lower the interpreter window when @@ -1595,7 +1595,7 @@ # check for problematic OS X Tk versions and print a warning # message in the IDLE shell window; this is less intrusive # than always opening a separate window. - tkversionwarning = macosxSupport.tkVersionWarning(root) + tkversionwarning = mac_osx_support.tkVersionWarning(root) if tkversionwarning: shell.interp.runcommand("print('%s')" % tkversionwarning) @@ -1605,7 +1605,7 @@ capture_warnings(False) if __name__ == "__main__": - sys.modules['PyShell'] = sys.modules['__main__'] + sys.modules['pyshell'] = sys.modules['__main__'] main() capture_warnings(False) # Make sure turned off; see issue 18081 diff -r d9e490f72476 Lib/idlelib/remote_debugger.py --- a/Lib/idlelib/remote_debugger.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/remote_debugger.py Tue May 19 03:18:15 2015 -0700 @@ -21,7 +21,7 @@ """ import types -from idlelib import Debugger +from idlelib import debugger debugging = 0 @@ -187,7 +187,7 @@ """ gui_proxy = GUIProxy(rpchandler, gui_adap_oid) - idb = Debugger.Idb(gui_proxy) + idb = debugger.Idb(gui_proxy) idb_adap = IdbAdapter(idb) rpchandler.register(idb_adap_oid, idb_adap) return idb_adap_oid @@ -362,7 +362,7 @@ idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\ (gui_adap_oid,), {}) idb_proxy = IdbProxy(rpcclt, pyshell, idb_adap_oid) - gui = Debugger.Debugger(pyshell, idb_proxy) + gui = debugger.Debugger(pyshell, idb_proxy) gui_adap = GUIAdapter(rpcclt, gui) rpcclt.register(gui_adap_oid, gui_adap) return gui @@ -373,7 +373,7 @@ Request that the RPCServer shut down the subprocess debugger and link. Unregister the GUIAdapter, which will cause a GC on the Idle process debugger and RPC link objects. (The second reference to the debugger GUI - is deleted in PyShell.close_remote_debugger().) + is deleted in pyshell.close_remote_debugger().) """ close_subprocess_debugger(rpcclt) diff -r d9e490f72476 Lib/idlelib/replace_dialog.py --- a/Lib/idlelib/replace_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/replace_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -1,13 +1,13 @@ from tkinter import * -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import search_engine +from idlelib.search_dialog_base import SearchDialogBase import re def replace(text): root = text._root() - engine = SearchEngine.get(root) + engine = search_engine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) dialog = engine._replacedialog @@ -153,7 +153,7 @@ pos = None if not pos: first = last = pos = text.index("insert") - line, col = SearchEngine.get_line_col(pos) + line, col = search_engine.get_line_col(pos) chars = text.get("%d.0" % line, "%d.0" % (line+1)) m = prog.match(chars, col) if not prog: diff -r d9e490f72476 Lib/idlelib/run.py --- a/Lib/idlelib/run.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/run.py Tue May 19 03:18:15 2015 -0700 @@ -7,15 +7,15 @@ import queue import tkinter -from idlelib import CallTips -from idlelib import AutoComplete +from idlelib import calltips +from idlelib import autocomplete -from idlelib import RemoteDebugger -from idlelib import RemoteObjectBrowser -from idlelib import StackViewer +from idlelib import remote_debugger +from idlelib import remote_object_browser +from idlelib import stack_viewer from idlelib import rpc -from idlelib import PyShell -from idlelib import IOBinding +from idlelib import pyshell +from idlelib import io_binding import __main__ @@ -32,7 +32,7 @@ if file is None: file = sys.stderr try: - file.write(PyShell.idle_formatwarning( + file.write(pyshell.idle_formatwarning( message, category, filename, lineno, line)) except IOError: pass # the file (probably stderr) is invalid - this warning gets lost. @@ -82,7 +82,7 @@ MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command - (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can + (e.g. remote_debugger.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. @@ -204,7 +204,7 @@ tbe = traceback.extract_tb(tb) print('Traceback (most recent call last):', file=efile) exclude = ("run.py", "rpc.py", "threading.py", "queue.py", - "RemoteDebugger.py", "bdb.py") + "remote_debugger.py", "bdb.py") cleanup_traceback(tbe, exclude) traceback.print_list(tbe, file=efile) lines = traceback.format_exception_only(typ, exc) @@ -298,12 +298,12 @@ executive = Executive(self) self.register("exec", executive) self.console = self.get_remote_proxy("console") - sys.stdin = PyShell.PseudoInputFile(self.console, "stdin", - IOBinding.encoding) - sys.stdout = PyShell.PseudoOutputFile(self.console, "stdout", - IOBinding.encoding) - sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", - IOBinding.encoding) + sys.stdin = pyshell.PseudoInputFile(self.console, "stdin", + io_binding.encoding) + sys.stdout = pyshell.PseudoOutputFile(self.console, "stdout", + io_binding.encoding) + sys.stderr = pyshell.PseudoOutputFile(self.console, "stderr", + io_binding.encoding) sys.displayhook = rpc.displayhook # page help() text to shell. @@ -339,8 +339,8 @@ def __init__(self, rpchandler): self.rpchandler = rpchandler self.locals = __main__.__dict__ - self.calltip = CallTips.CallTips() - self.autocomplete = AutoComplete.AutoComplete() + self.calltip = calltips.CallTips() + self.autocomplete = autocomplete.AutoComplete() def runcode(self, code): global interruptable @@ -372,7 +372,7 @@ thread.interrupt_main() def start_the_debugger(self, gui_adap_oid): - return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) + return remote_debugger.start_debugger(self.rpchandler, gui_adap_oid) def stop_the_debugger(self, idb_adap_oid): "Unregister the Idb Adapter. Link objects and Idb then subject to GC" @@ -396,7 +396,7 @@ tb = tb.tb_next sys.last_type = typ sys.last_value = val - item = StackViewer.StackTreeItem(flist, tb) - return RemoteObjectBrowser.remote_object_tree_item(item) + item = stack_viewer.StackTreeItem(flist, tb) + return remote_object_browser.remote_object_tree_item(item) capture_warnings(False) # Make sure turned off; see issue 18081 diff -r d9e490f72476 Lib/idlelib/script_binding.py --- a/Lib/idlelib/script_binding.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/script_binding.py Tue May 19 03:18:15 2015 -0700 @@ -21,10 +21,10 @@ import tabnanny import tokenize import tkinter.messagebox as tkMessageBox -from idlelib import PyShell +from idlelib import pyshell -from idlelib.configHandler import idleConf -from idlelib import macosxSupport +from idlelib.config_handler import idleConf +from idlelib import mac_osx_support indent_message = """Error: Inconsistent indentation detected! @@ -45,12 +45,12 @@ def __init__(self, editwin): self.editwin = editwin - # Provide instance variables referenced by Debugger + # Provide instance variables referenced by debugger # XXX This should be done differently self.flist = self.editwin.flist self.root = self.editwin.root - if macosxSupport.isCocoaTk(): + if mac_osx_support.isCocoaTk(): self.editwin.text_frame.bind('<>', self._run_module_event) def check_module_event(self, event): @@ -111,7 +111,7 @@ shell.set_warning_stream(saved_stream) def run_module_event(self, event): - if macosxSupport.isCocoaTk(): + if mac_osx_support.isCocoaTk(): # Tk-Cocoa in MacOSX is broken until at least # Tk 8.5.9, and without this rather # crude workaround IDLE would hang when a user @@ -141,7 +141,7 @@ if not self.tabnanny(filename): return 'break' interp = self.shell.interp - if PyShell.use_subprocess: + if pyshell.use_subprocess: interp.restart_subprocess(with_cwd=False) dirname = os.path.dirname(filename) # XXX Too often this discards arguments the user just set... @@ -159,7 +159,7 @@ interp.prepend_syspath(filename) # XXX KBK 03Jul04 When run w/o subprocess, runtime warnings still # go to __stderr__. With subprocess, they go to the shell. - # Need to change streams in PyShell.ModifiedInterpreter. + # Need to change streams in pyshell.ModifiedInterpreter. interp.runcode(code) return 'break' diff -r d9e490f72476 Lib/idlelib/search_dialog.py --- a/Lib/idlelib/search_dialog.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/search_dialog.py Tue May 19 03:18:15 2015 -0700 @@ -1,11 +1,11 @@ from tkinter import * -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import search_engine +from idlelib.search_dialog_base import SearchDialogBase def _setup(text): root = text._root() - engine = SearchEngine.get(root) + engine = search_engine.get(root) if not hasattr(engine, "_searchdialog"): engine._searchdialog = SearchDialog(root, engine) return engine._searchdialog diff -r d9e490f72476 Lib/idlelib/search_dialog_base.py --- a/Lib/idlelib/search_dialog_base.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/search_dialog_base.py Tue May 19 03:18:15 2015 -0700 @@ -125,7 +125,7 @@ def create_option_buttons(self): '''Return (filled frame, options) for testing. - Options is a list of SearchEngine booleanvar, label pairs. + Options is a list of search_engine booleanvar, label pairs. A gridded frame from make_frame is filled with a Checkbutton for each pair, bound to the var, with the corresponding label. ''' diff -r d9e490f72476 Lib/idlelib/search_engine.py --- a/Lib/idlelib/search_engine.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/search_engine.py Tue May 19 03:18:15 2015 -0700 @@ -57,7 +57,7 @@ def setcookedpat(self, pat): "Set pattern after escaping if re." - # called only in SearchDialog.py: 66 + # called only in search_dialog.py: 66 if self.isre(): pat = re.escape(pat) self.setpat(pat) diff -r d9e490f72476 Lib/idlelib/stack_viewer.py --- a/Lib/idlelib/stack_viewer.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/stack_viewer.py Tue May 19 03:18:15 2015 -0700 @@ -4,9 +4,9 @@ import re import tkinter as tk -from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem -from idlelib.PyShell import PyShellFileList +from idlelib.tree_widget import TreeNode, TreeItem, ScrolledCanvas +from idlelib.object_browser import ObjectTreeItem, make_objecttreeitem +from idlelib.pyshell import PyShellFileList def StackBrowser(root, flist=None, tb=None, top=None): if top is None: diff -r d9e490f72476 Lib/idlelib/tree_widget.py --- a/Lib/idlelib/tree_widget.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/tree_widget.py Tue May 19 03:18:15 2015 -0700 @@ -17,8 +17,8 @@ import os from tkinter import * -from idlelib import ZoomHeight -from idlelib.configHandler import idleConf +from idlelib import zoom_height +from idlelib.config_handler import idleConf ICONDIR = "Icons" @@ -445,7 +445,7 @@ self.canvas.yview_scroll(1, "unit") return "break" def zoom_height(self, event): - ZoomHeight.zoom_height(self.master) + zoom_height.zoom_height(self.master) return "break" diff -r d9e490f72476 Lib/idlelib/undo_delegator.py --- a/Lib/idlelib/undo_delegator.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/undo_delegator.py Tue May 19 03:18:15 2015 -0700 @@ -1,7 +1,7 @@ import string from tkinter import * -from idlelib.Delegator import Delegator +from idlelib.delegator import Delegator #$ event <> #$ win @@ -337,7 +337,7 @@ return self.depth def _undo_delegator(parent): - from idlelib.Percolator import Percolator + from idlelib.percolator import Percolator root = Tk() root.title("Test UndoDelegator") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff -r d9e490f72476 Lib/idlelib/widget_redirector.py --- a/Lib/idlelib/widget_redirector.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/widget_redirector.py Tue May 19 03:18:15 2015 -0700 @@ -104,7 +104,7 @@ Note that if a registered function is called, the operation is not passed through to Tk. Apply the function returned by self.register() - to *args to accomplish that. For an example, see ColorDelegator.py. + to *args to accomplish that. For an example, see color_delegator.py. ''' m = self._operations.get(operation) diff -r d9e490f72476 Lib/idlelib/zoom_height.py --- a/Lib/idlelib/zoom_height.py Mon May 18 15:05:43 2015 -0700 +++ b/Lib/idlelib/zoom_height.py Tue May 19 03:18:15 2015 -0700 @@ -3,7 +3,7 @@ import re import sys -from idlelib import macosxSupport +from idlelib import mac_osx_support class ZoomHeight: @@ -32,7 +32,7 @@ newy = 0 newheight = newheight - 72 - elif macosxSupport.isAquaTk(): + elif mac_osx_support.isAquaTk(): # The '88' below is a magic number that avoids placing the bottom # of the window below the panel on my machine. I don't know how # to calculate the correct value for this with tkinter.