summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/macosx.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-05-28 17:22:31 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-05-28 17:22:31 (GMT)
commit6fa5bdc6e85ec48925bc0d856b134f59d01c300f (patch)
tree8fb1448859375e577abfa091437f1da2b4816e86 /Lib/idlelib/macosx.py
parent0d9220e162f1e5f8caa3d7ebaa54665776d361a1 (diff)
downloadcpython-6fa5bdc6e85ec48925bc0d856b134f59d01c300f.zip
cpython-6fa5bdc6e85ec48925bc0d856b134f59d01c300f.tar.gz
cpython-6fa5bdc6e85ec48925bc0d856b134f59d01c300f.tar.bz2
Issue #24225: Within idlelib files, update idlelib module names.
This follows the previous patch that changed idlelib file names. Class names that matched old module names are not changed. Change idlelib imports in turtledemo.__main__. Exception: config-extensions.def. Previously, extension section names, file names, and class names had to match. Changing section names would create cross-version conflicts in config-extensions.cfg (user customizations). Instead map old names to new file names at point of import in editor.EditorWindow.load_extension. Patch extensively tested with test_idle, idle_test.htest.py, a custom import-all test, running IDLE in a console to catch messages, and testing each menu item. Based on a patch by Al Sweigart.
Diffstat (limited to 'Lib/idlelib/macosx.py')
-rw-r--r--Lib/idlelib/macosx.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py
index 268426f..1e16f2c 100644
--- a/Lib/idlelib/macosx.py
+++ b/Lib/idlelib/macosx.py
@@ -123,23 +123,23 @@ def overrideRootMenu(root, flist):
# 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 mainmenu
+ from idlelib import windows
- closeItem = Bindings.menudefs[0][1][-2]
+ closeItem = mainmenu.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 mainmenu.menudefs[0][1][-3:]
+ mainmenu.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 mainmenu.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 mainmenu.menudefs[-2][1][0]
menubar = Menu(root)
root.configure(menu=menubar)
menudict = {}
@@ -154,30 +154,30 @@ def overrideRootMenu(root, flist):
if end > 0:
menu.delete(0, end)
- WindowList.add_windows_to_menu(menu)
- WindowList.register_callback(postwindowsmenu)
+ windows.add_windows_to_menu(menu)
+ Windows.register_callback(postwindowsmenu)
def about_dialog(event=None):
"Handle Help 'About IDLE' event."
- # Synchronize with EditorWindow.EditorWindow.about_dialog.
- from idlelib import aboutDialog
- aboutDialog.AboutDialog(root, 'About IDLE')
+ # Synchronize with editor.EditorWindow.about_dialog.
+ from idlelib import help_about
+ help_about.AboutDialog(root, 'About IDLE')
def config_dialog(event=None):
"Handle Options 'Configure IDLE' event."
- # Synchronize with EditorWindow.EditorWindow.config_dialog.
- from idlelib import configDialog
+ # Synchronize with editor.EditorWindow.config_dialog.
+ from idlelib import configdialog
# Ensure that the root object has an instance_dict attribute,
# mirrors code in EditorWindow (although that sets the attribute
# on an EditorWindow instance that is then passed as the first
# argument to ConfigDialog)
root.instance_dict = flist.inversedict
- configDialog.ConfigDialog(root, 'Settings')
+ configdialog.ConfigDialog(root, 'Settings')
def help_dialog(event=None):
"Handle Help 'IDLE Help' event."
- # Synchronize with EditorWindow.EditorWindow.help_dialog.
+ # Synchronize with editor.EditorWindow.help_dialog.
from idlelib import help
help.show_idlehelp(root)
@@ -197,7 +197,7 @@ def overrideRootMenu(root, flist):
menudict['application'] = menu = Menu(menubar, name='apple',
tearoff=0)
menubar.add_cascade(label='IDLE', menu=menu)
- Bindings.menudefs.insert(0,
+ mainmenu.menudefs.insert(0,
('application', [
('About IDLE', '<<about-idle>>'),
None,
@@ -205,7 +205,7 @@ def overrideRootMenu(root, flist):
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(
+ mainmenu.menudefs[0][1].append(
('_Preferences....', '<<open-config-dialog>>'),
)
if isCocoaTk():
@@ -214,12 +214,12 @@ def overrideRootMenu(root, flist):
# 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 mainmenu.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)