mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-27099: IDLE - Convert built-in extensions to regular features (#2494)
About 10 IDLE features were implemented as supposedly optional extensions. Their different behavior could be confusing or worse for users and not good for maintenance. Hence the conversion. The main difference for users is that user configurable key bindings for builtin features are now handled uniformly. Now, editing a binding in a keyset only affects its value in the keyset. All bindings are defined together in the system-specific default keysets in config- extensions.def. All custom keysets are saved as a whole in config- extension.cfg. All take effect as soon as one clicks Apply or Ok. The affected events are '<<force-open-completions>>', '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not affect their keyset- specific customization after 3.6.3. and vice versa. Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.
This commit is contained in:
parent
d39dbf4cf1
commit
58fc71c447
21 changed files with 451 additions and 272 deletions
|
@ -1,22 +1,14 @@
|
|||
"""Extension to execute code outside the Python shell window.
|
||||
"""Execute code from an editor.
|
||||
|
||||
This adds the following commands:
|
||||
Check module: do a full syntax check of the current module.
|
||||
Also run the tabnanny to catch any inconsistent tabs.
|
||||
|
||||
- Check module does a full syntax check of the current module.
|
||||
It also runs the tabnanny to catch any inconsistent tabs.
|
||||
|
||||
- Run module executes the module's code in the __main__ namespace. The window
|
||||
must have been saved previously. The module is added to sys.modules, and is
|
||||
also added to the __main__ namespace.
|
||||
|
||||
XXX GvR Redesign this interface (yet again) as follows:
|
||||
|
||||
- Present a dialog box for ``Run Module''
|
||||
|
||||
- Allow specify command line arguments in the dialog box
|
||||
Run module: also execute the module's code in the __main__ namespace.
|
||||
The window must have been saved previously. The module is added to
|
||||
sys.modules, and is also added to the __main__ namespace.
|
||||
|
||||
TODO: Specify command line arguments in a dialog box.
|
||||
"""
|
||||
|
||||
import os
|
||||
import tabnanny
|
||||
import tokenize
|
||||
|
@ -40,11 +32,6 @@ by Format->Untabify Region and specify the number of columns used by each tab.
|
|||
|
||||
class ScriptBinding:
|
||||
|
||||
menudefs = [
|
||||
('run', [None,
|
||||
('Check Module', '<<check-module>>'),
|
||||
('Run Module', '<<run-module>>'), ]), ]
|
||||
|
||||
def __init__(self, editwin):
|
||||
self.editwin = editwin
|
||||
# Provide instance variables referenced by debugger
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue