Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 1 | README.txt: an index to idlelib files and the IDLE menu. |
Steven M. Gava | d39993e | 2001-07-20 01:36:49 +0000 | [diff] [blame] | 2 | |
Terry Jan Reedy | 5aeadb3 | 2015-12-18 15:46:57 -0500 | [diff] [blame] | 3 | IDLE is Python's Integrated Development and Learning |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 4 | Environment. The user documentation is part of the Library Reference and |
| 5 | is available in IDLE by selecting Help => IDLE Help. This README documents |
| 6 | idlelib for IDLE developers and curious users. |
Steven M. Gava | d39993e | 2001-07-20 01:36:49 +0000 | [diff] [blame] | 7 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 8 | IDLELIB FILES lists files alphabetically by category, |
| 9 | with a short description of each. |
Kurt B. Kaiser | 5ddef75 | 2003-06-01 01:11:14 +0000 | [diff] [blame] | 10 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 11 | IDLE MENU show the menu tree, annotated with the module |
| 12 | or module object that implements the corresponding function. |
Kurt B. Kaiser | f5934dd | 2002-12-31 17:56:18 +0000 | [diff] [blame] | 13 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 14 | This file is descriptive, not prescriptive, and may have errors |
| 15 | and omissions and lag behind changes in idlelib. |
Kurt B. Kaiser | 1821056 | 2003-06-12 03:51:27 +0000 | [diff] [blame] | 16 | |
| 17 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 18 | IDLELIB FILES |
Berker Peksag | c16387b | 2016-09-28 17:21:52 +0300 | [diff] [blame] | 19 | Implementation files not in IDLE MENU are marked (nim). |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 20 | Deprecated files and objects are listed separately as the end. |
Kurt B. Kaiser | 1821056 | 2003-06-12 03:51:27 +0000 | [diff] [blame] | 21 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 22 | Startup |
| 23 | ------- |
| 24 | __init__.py # import, does nothing |
| 25 | __main__.py # -m, starts IDLE |
| 26 | idle.bat |
| 27 | idle.py |
| 28 | idle.pyw |
Kurt B. Kaiser | 1821056 | 2003-06-12 03:51:27 +0000 | [diff] [blame] | 29 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 30 | Implementation |
| 31 | -------------- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 32 | autocomplete.py # Complete attribute names or filenames. |
| 33 | autocomplete_w.py # Display completions. |
| 34 | autoexpand.py # Expand word with previous word in file. |
| 35 | browser.py # Create module browser window. |
| 36 | calltip_w.py # Display calltip. |
| 37 | calltips.py # Create calltip text. |
| 38 | codecontext.py # Show compound statement headers otherwise not visible. |
| 39 | colorizer.py # Colorize text (nim) |
| 40 | config.py # Load, fetch, and save configuration (nim). |
| 41 | configdialog.py # Display user configuration dialogs. |
| 42 | config_help.py # Specify help source in configdialog. |
| 43 | config_key.py # Change keybindings. |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 44 | dynoption.py # Define mutable OptionMenu widget (nim). |
| 45 | debugobj.py # Define class used in stackviewer. |
| 46 | debugobj_r.py # Communicate objects between processes with rpc (nim). |
| 47 | debugger.py # Debug code run from shell or editor; show window. |
| 48 | debugger_r.py # Debug code run in remote process. |
| 49 | delegator.py # Define base class for delegators (nim). |
| 50 | editor.py # Define most of editor and utility functions. |
| 51 | filelist.py # Open files and manage list of open windows (nim). |
| 52 | grep.py # Find all occurrences of pattern in multiple files. |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 53 | help.py # Display IDLE's html doc. |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 54 | help_about.py # Display About IDLE dialog. |
| 55 | history.py # Get previous or next user input in shell (nim) |
| 56 | hyperparser.py # Parse code around a given index. |
| 57 | iomenu.py # Open, read, and write files |
| 58 | macosx.py # Help IDLE run on Macs (nim). |
| 59 | mainmenu.py # Define most of IDLE menu. |
| 60 | multicall.py # Wrap tk widget to allow multiple calls per event (nim). |
| 61 | outwin.py # Create window for grep output. |
| 62 | paragraph.py # Re-wrap multiline strings and comments. |
| 63 | parenmatch.py # Match fenceposts: (), [], and {}. |
| 64 | pathbrowser.py # Create path browser window. |
| 65 | percolator.py # Manage delegator stack (nim). |
| 66 | pyparse.py # Give information on code indentation |
| 67 | pyshell.py # Start IDLE, manage shell, complete editor window |
Raymond Hettinger | 15f44ab | 2016-08-30 10:47:49 -0700 | [diff] [blame] | 68 | query.py # Query user for information |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 69 | redirector.py # Intercept widget subcommands (for percolator) (nim). |
| 70 | replace.py # Search and replace pattern in text. |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 71 | rpc.py # Commuicate between idle and user processes (nim). |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 72 | rstrip.py # Strip trailing whitespace. |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 73 | run.py # Manage user code execution subprocess. |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 74 | runscript.py # Check and run user code. |
| 75 | scrolledlist.py # Define scrolledlist widget for IDLE (nim). |
| 76 | search.py # Search for pattern in text. |
| 77 | searchbase.py # Define base for search, replace, and grep dialogs. |
| 78 | searchengine.py # Define engine for all 3 search dialogs. |
| 79 | stackviewer.py # View stack after exception. |
| 80 | statusbar.py # Define status bar for windows (nim). |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 81 | tabbedpages.py # Define tabbed pages widget (nim). |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 82 | textview.py # Define read-only text widget (nim). |
| 83 | tree.py # Define tree widger, used in browsers (nim). |
| 84 | undo.py # Manage undo stack. |
| 85 | windows.py # Manage window list and define listed top level. |
| 86 | zoomheight.py # Zoom window to full height of screen. |
Kurt B. Kaiser | 1821056 | 2003-06-12 03:51:27 +0000 | [diff] [blame] | 87 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 88 | Configuration |
| 89 | ------------- |
| 90 | config-extensions.def # Defaults for extensions |
| 91 | config-highlight.def # Defaults for colorizing |
| 92 | config-keys.def # Defaults for key bindings |
| 93 | config-main.def # Defai;ts fpr font and geneal |
Kurt B. Kaiser | a7b804f | 2003-01-10 21:27:23 +0000 | [diff] [blame] | 94 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 95 | Text |
| 96 | ---- |
| 97 | CREDITS.txt # not maintained, displayed by About IDLE |
| 98 | HISTORY.txt # NEWS up to July 2001 |
| 99 | NEWS.txt # commits, displayed by About IDLE |
| 100 | README.txt # this file, displeyed by About IDLE |
| 101 | TODO.txt # needs review |
| 102 | extend.txt # about writing extensions |
| 103 | help.html # copy of idle.html in docs, displayed by IDLE Help |
Kurt B. Kaiser | a7b804f | 2003-01-10 21:27:23 +0000 | [diff] [blame] | 104 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 105 | Subdirectories |
| 106 | -------------- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 107 | Icons # small image files |
| 108 | idle_test # files for human test and automated unit tests |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 109 | |
| 110 | Unused and Deprecated files and objects (nim) |
| 111 | --------------------------------------------- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 112 | tooltip.py # unused |
| 113 | |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 114 | |
| 115 | |
| 116 | IDLE MENUS |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 117 | Top level items and most submenu items are defined in mainmenu. |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 118 | Extenstions add submenu items when active. The names given are |
| 119 | found, quoted, in one of these modules, paired with a '<<pseudoevent>>'. |
| 120 | Each pseudoevent is bound to an event handler. Some event handlers |
| 121 | call another function that does the actual work. The annotations below |
| 122 | are intended to at least give the module where the actual work is done. |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 123 | 'eEW' = editor.EditorWindow |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 124 | |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 125 | File |
| 126 | New File # eEW.new_callback |
| 127 | Open... # iomenu.open |
| 128 | Open Module # eEw.open_module |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 129 | Recent Files |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 130 | Class Browser # eEW.open_class_browser, browser.ClassBrowser |
| 131 | Path Browser # eEW.open_path_browser, pathbrowser |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 132 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 133 | Save # iomenu.save |
| 134 | Save As... # iomenu.save_as |
| 135 | Save Copy As... # iomenu.save_a_copy |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 136 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 137 | Print Window # iomenu.print_window |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 138 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 139 | Close # eEW.close_event |
| 140 | Exit # flist.close_all_callback (bound in eEW) |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 141 | |
| 142 | Edit |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 143 | Undo # undodelegator |
| 144 | Redo # undodelegator |
| 145 | --- # eEW.right_menu_event |
| 146 | Cut # eEW.cut |
| 147 | Copy # eEW.copy |
| 148 | Paste # eEW.past |
| 149 | Select All # eEW.select_all (+ see eEW.remove_selection) |
| 150 | --- # Next 5 items use searchengine; dialogs use searchbase |
| 151 | Find # eEW.find_event, search.SearchDialog.find |
| 152 | Find Again # eEW.find_again_event, sSD.find_again |
| 153 | Find Selection # eEW.find_selection_event, sSD.find_selection |
| 154 | Find in Files... # eEW.find_in_files_event, grep |
| 155 | Replace... # eEW.replace_event, replace.ReplaceDialog.replace |
| 156 | Go to Line # eEW.goto_line_event |
| 157 | Show Completions # autocomplete extension and autocompleteWidow (&HP) |
| 158 | Expand Word # autoexpand extension |
| 159 | Show call tip # Calltips extension and CalltipWindow (& Hyperparser) |
| 160 | Show surrounding parens # parenmatch (& Hyperparser) |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 161 | |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 162 | Shell # pyshell |
Terry Jan Reedy | 3dad1a5 | 2016-09-12 01:57:25 -0400 | [diff] [blame] | 163 | View Last Restart # pyshell.PyShell.view_restart_mark |
| 164 | Restart Shell # pyshell.PyShell.restart_shell |
Terry Jan Reedy | 4b73676 | 2016-09-12 01:50:03 -0400 | [diff] [blame] | 165 | Interrupt Execution # pyshell.PyShell.cancel_callback |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 166 | |
| 167 | Debug (Shell only) |
| 168 | Go to File/Line |
Terry Jan Reedy | 3dad1a5 | 2016-09-12 01:57:25 -0400 | [diff] [blame] | 169 | debugger # debugger, debugger_r, PyShell.toggle_debuger |
| 170 | Stack Viewer # stackviewer, PyShell.open_stack_viewer |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 171 | Auto-open Stack Viewer # stackviewer |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 172 | |
| 173 | Format (Editor only) |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 174 | Indent Region # eEW.indent_region_event |
| 175 | Dedent Region # eEW.dedent_region_event |
| 176 | Comment Out Reg. # eEW.comment_region_event |
| 177 | Uncomment Region # eEW.uncomment_region_event |
| 178 | Tabify Region # eEW.tabify_region_event |
| 179 | Untabify Region # eEW.untabify_region_event |
| 180 | Toggle Tabs # eEW.toggle_tabs_event |
| 181 | New Indent Width # eEW.change_indentwidth_event |
| 182 | Format Paragraph # paragraph extension |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 183 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 184 | Strip tailing whitespace # rstrip extension |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 185 | |
| 186 | Run (Editor only) |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 187 | Python Shell # pyshell |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 188 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 189 | Check Module # runscript |
| 190 | Run Module # runscript |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 191 | |
| 192 | Options |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 193 | Configure IDLE # eEW.config_dialog, configdialog |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 194 | (tabs in the dialog) |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 195 | Font tab # config-main.def |
Terry Jan Reedy | 0cd6b97 | 2016-07-03 19:11:13 -0400 | [diff] [blame] | 196 | Highlight tab # query, config-highlight.def |
| 197 | Keys tab # query, config_key, config_keys.def |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 198 | General tab # config_help, config-main.def |
| 199 | Extensions tab # config-extensions.def, corresponding .py |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 200 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 201 | Code Context (ed)# codecontext extension |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 202 | |
| 203 | Window |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 204 | Zoomheight # zoomheight extension |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 205 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 206 | <open windows> # windows |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 207 | |
| 208 | Help |
Serhiy Storchaka | 13ad3b7 | 2017-09-14 09:38:36 +0300 | [diff] [blame] | 209 | About IDLE # eEW.about_dialog, help_about.AboutDialog |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 210 | --- |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 211 | IDLE Help # eEW.help_dialog, helpshow_idlehelp |
| 212 | Python Doc # eEW.python_docs |
| 213 | Turtle Demo # eEW.open_turtle_demo |
Terry Jan Reedy | d470527 | 2015-10-02 23:22:59 -0400 | [diff] [blame] | 214 | --- |
| 215 | <other help sources> |
| 216 | |
| 217 | <Context Menu> (right click) |
Terry Jan Reedy | d80ab7d | 2016-05-31 20:17:58 -0400 | [diff] [blame] | 218 | Defined in editor, PyShelpyshellut |
| 219 | Cut |
| 220 | Copy |
| 221 | Paste |
| 222 | --- |
| 223 | Go to file/line (shell and output only) |
| 224 | Set Breakpoint (editor only) |
| 225 | Clear Breakpoint (editor only) |
| 226 | Defined in debugger |
| 227 | Go to source line |
| 228 | Show stack frame |
| 229 | |
| 230 | <No menu> |
| 231 | Center Insert # eEW.center_insert_event |
Terry Jan Reedy | bfbaa6b | 2016-08-31 00:50:55 -0400 | [diff] [blame] | 232 | |
Serhiy Storchaka | 13ad3b7 | 2017-09-14 09:38:36 +0300 | [diff] [blame] | 233 | |
Terry Jan Reedy | bfbaa6b | 2016-08-31 00:50:55 -0400 | [diff] [blame] | 234 | CODE STYLE -- Generally PEP 8. |
| 235 | |
| 236 | import |
| 237 | ------ |
| 238 | Put import at the top, unless there is a good reason otherwise. |
| 239 | PEP 8 says to group stdlib, 3rd-party dependencies, and package imports. |
| 240 | For idlelib, the groups are general stdlib, tkinter, and idlelib. |
| 241 | Sort modules within each group, except that tkinter.ttk follows tkinter. |
| 242 | Sort 'from idlelib import mod1' and 'from idlelib.mod2 import object' |
| 243 | together by module, ignoring within module objects. |
| 244 | Put 'import __main__' after other idlelib imports. |
| 245 | |
Terry Jan Reedy | 83a1045 | 2016-08-31 19:37:28 -0400 | [diff] [blame] | 246 | Imports only needed for testing are put not at the top but in an |
| 247 | htest function def or "if __name__ == '__main__'" clause. |
Terry Jan Reedy | bfbaa6b | 2016-08-31 00:50:55 -0400 | [diff] [blame] | 248 | |
| 249 | Within module imports like "from idlelib.mod import class" may cause |
| 250 | circular imports to deadlock. Even without this, circular imports may |
| 251 | require at least one of the imports to be delayed until a function call. |