mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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,9 +1,8 @@
|
|||
"""calltips.py - An IDLE Extension to Jog Your Memory
|
||||
"""Pop up a reminder of how to call a function.
|
||||
|
||||
Call Tips are floating windows which display function, class, and method
|
||||
parameter and docstring information when you type an opening parenthesis, and
|
||||
which disappear when you type a closing parenthesis.
|
||||
|
||||
"""
|
||||
import inspect
|
||||
import re
|
||||
|
@ -15,13 +14,8 @@ from idlelib import calltip_w
|
|||
from idlelib.hyperparser import HyperParser
|
||||
import __main__
|
||||
|
||||
class CallTips:
|
||||
|
||||
menudefs = [
|
||||
('edit', [
|
||||
("Show call tip", "<<force-open-calltip>>"),
|
||||
])
|
||||
]
|
||||
class CallTips:
|
||||
|
||||
def __init__(self, editwin=None):
|
||||
if editwin is None: # subprocess and test
|
||||
|
@ -103,6 +97,7 @@ class CallTips:
|
|||
else:
|
||||
return get_argspec(get_entity(expression))
|
||||
|
||||
|
||||
def get_entity(expression):
|
||||
"""Return the object corresponding to expression evaluated
|
||||
in a namespace spanning sys.modules and __main.dict__.
|
||||
|
@ -126,7 +121,6 @@ _default_callable_argspec = "See source or doc"
|
|||
_invalid_method = "invalid method signature"
|
||||
_argument_positional = "\n['/' marks preceding arguments as positional-only]\n"
|
||||
|
||||
|
||||
def get_argspec(ob):
|
||||
'''Return a string describing the signature of a callable object, or ''.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue