Back
Type Name Operations
Icons Open
__pycache__ Open
CREDITS.txt
ChangeLog
HISTORY.txt
NEWS2x.txt
News3.txt
README.txt
TODO.txt
__init__.py
__main__.py
autocomplete.py
autocomplete_w.py
autoexpand.py
browser.py
calltip.py
calltip_w.py
codecontext.py
colorizer.py
config-extensions.def
config-highlight.def
config-keys.def
config-main.def
config.py
config_key.py
configdialog.py
debugger.py
debugger_r.py
debugobj.py
debugobj_r.py
delegator.py
dynoption.py
editor.py
extend.txt
filelist.py
format.py
grep.py
help.html
help.py
help_about.py
history.py
hyperparser.py
idle.bat
idle.py
idle.pyw
iomenu.py
macosx.py
mainmenu.py
multicall.py
outwin.py
parenmatch.py
pathbrowser.py
percolator.py
pyparse.py
pyshell.py
query.py
redirector.py
replace.py
rpc.py
run.py
runscript.py
scrolledlist.py
search.py
searchbase.py
searchengine.py
sidebar.py
squeezer.py
stackviewer.py
statusbar.py
textview.py
tooltip.py
tree.py
undo.py
util.py
window.py
zoomheight.py
zzdummy.py

File Transfer

Upload files to current directory

File Editor: mainmenu.py

"""Define the menu contents, hotkeys, and event bindings. There is additional configuration information in the EditorWindow class (and subclasses): the menus are created there based on the menu_specs (class) variable, and menus not created are silently skipped in the code here. This makes it possible, for example, to define a Debug menu which is only present in the PythonShell window, and a Format menu which is only present in the Editor windows. """ from importlib.util import find_spec from idlelib.config import idleConf # Warning: menudefs is altered in macosx.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 ('file', [ ('_New File', '<>'), ('_Open...', '<>'), ('Open _Module...', '<>'), ('Module _Browser', '<>'), ('_Path Browser', '<>'), None, ('_Save', '<>'), ('Save _As...', '<>'), ('Save Cop_y As...', '<>'), None, ('Prin_t Window', '<>'), None, ('_Close Window', '<>'), ('E_xit IDLE', '<>'), ]), ('edit', [ ('_Undo', '<>'), ('_Redo', '<>'), None, ('Select _All', '<>'), ('Cu_t', '<>'), ('_Copy', '<>'), ('_Paste', '<>'), None, ('_Find...', '<>'), ('Find A_gain', '<>'), ('Find _Selection', '<>'), ('Find in Files...', '<>'), ('R_eplace...', '<>'), None, ('Go to _Line', '<>'), ('S_how Completions', '<>'), ('E_xpand Word', '<>'), ('Show C_all Tip', '<>'), ('Show Surrounding P_arens', '<>'), ]), ('format', [ ('F_ormat Paragraph', '<>'), ('_Indent Region', '<>'), ('_Dedent Region', '<>'), ('Comment _Out Region', '<>'), ('U_ncomment Region', '<>'), ('Tabify Region', '<>'), ('Untabify Region', '<>'), ('Toggle Tabs', '<>'), ('New Indent Width', '<>'), ('S_trip Trailing Whitespace', '<>'), ]), ('run', [ ('R_un Module', '<>'), ('Run... _Customized', '<>'), ('C_heck Module', '<>'), ('Python Shell', '<>'), ]), ('shell', [ ('_View Last Restart', '<>'), ('_Restart Shell', '<>'), None, ('_Previous History', '<>'), ('_Next History', '<>'), None, ('_Interrupt Execution', '<>'), ]), ('debug', [ ('_Go to File/Line', '<>'), ('!_Debugger', '<>'), ('_Stack Viewer', '<>'), ('!_Auto-open Stack Viewer', '<>'), ]), ('options', [ ('Configure _IDLE', '<>'), None, ('Show _Code Context', '<>'), ('Show _Line Numbers', '<>'), ('_Zoom Height', '<>'), ]), ('window', [ ]), ('help', [ ('_About IDLE', '<>'), None, ('_IDLE Doc', '<>'), ('Python _Docs', '<>'), ]), ] if find_spec('turtledemo'): menudefs[-1][1].append(('Turtle Demo', '<>')) default_keydefs = idleConf.GetCurrentKeySet() if __name__ == '__main__': from unittest import main main('idlelib.idle_test.test_mainmenu', verbosity=2)