README.txt 9.4 KB

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