summaryrefslogtreecommitdiff
path: root/Lib/idlelib/Bindings.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-02-01 17:59:49 -0500
committerBenjamin Peterson <benjamin@python.org>2015-02-01 17:59:49 -0500
commit596ffac4b9ff54aeb2134988bb85b3c492ae5849 (patch)
treebf0d44eaf89cefa4bbda16672c882ad3667b433d /Lib/idlelib/Bindings.py
parentc67c6e554e82f48627dd4e3b70232ca73d00ec64 (diff)
parent08e89d1aa305a920347fd4d7350684ff37c238f9 (diff)
downloadcpython-596ffac4b9ff54aeb2134988bb85b3c492ae5849.tar.gz
merge 3.3 (#23369)
Diffstat (limited to 'Lib/idlelib/Bindings.py')
-rw-r--r--Lib/idlelib/Bindings.py38
1 files changed, 13 insertions, 25 deletions
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index 65c0317e60..226671ccdb 100644
--- a/Lib/idlelib/Bindings.py
+++ b/Lib/idlelib/Bindings.py
@@ -8,9 +8,16 @@ the PythonShell window, and a Format menu which is only present in the Editor
windows.
"""
-import sys
+from importlib.util import find_spec
+
from idlelib.configHandler import idleConf
-from idlelib import macosxSupport
+
+# Warning: menudefs is altered in macosxSupport.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
+# without altering overrideRootMenu() as well.
+# TODO: Make this more robust
menudefs = [
# underscore prefixes character to underscore
@@ -70,7 +77,8 @@ menudefs = [
('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'),
]),
('options', [
- ('_Configure IDLE...', '<<open-config-dialog>>'),
+ ('Configure _IDLE', '<<open-config-dialog>>'),
+ ('Configure _Extensions', '<<open-config-extensions-dialog>>'),
None,
]),
('help', [
@@ -81,27 +89,7 @@ menudefs = [
]),
]
-if macosxSupport.runningAsOSXApp():
- # Running as a proper MacOS application bundle. This block restructures
- # the menus a little to make them conform better to the HIG.
-
- quitItem = menudefs[0][1][-1]
- closeItem = 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 menudefs[0][1][-3:]
- menudefs[0][1].insert(6, closeItem)
-
- # Remove the 'About' entry from the help menu, it is in the application
- # menu
- del menudefs[-1][1][0:2]
-
- # Remove the 'Configure' entry from the options menu, it is in the
- # application menu as 'Preferences'
- del menudefs[-2][1][0:2]
+if find_spec('turtledemo'):
+ menudefs[-1][1].append(('Turtle Demo', '<<open-turtle-demo>>'))
default_keydefs = idleConf.GetCurrentKeySet()
-
-del sys