Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d993c87

Browse files
committed
Quick update to the extension mechanism (extend.py is gone, long live
config.txt). *** This is a bugfix-release candidate (for 2.1.1 and 2.0.1)! ***
1 parent afb6ae8 commit d993c87

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

Tools/idle/extend.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ to make other changes to IDLE, but this must be done by editing the IDLE
77
source code.)
88

99
The list of extensions loaded at startup time is configured by editing
10-
the file extend.py; see below for details.
10+
the file config.txt; see below for details.
1111

1212
An IDLE extension is defined by a class. Methods of the class define
1313
actions that are invoked by those bindings or menu entries. Class (or
@@ -86,11 +86,25 @@ class ZoomHeight:
8686
def zoom_height_event(self, event):
8787
"...Do what you want here..."
8888

89-
The final piece of the puzzle is the file "extend.py", which contains a
90-
simple table used to configure the loading of extensions. This file
91-
currently contains a single list variable named "standard", which is a
92-
list of extension names that are to be loaded. (In the future, other
93-
configuration variables may be added to this module.)
89+
The final piece of the puzzle is the file "config.txt", which is used
90+
to to configure the loading of extensions. For each extension,
91+
you must include a section in config.txt (or in any of the other
92+
configuration files that are consulted at startup: config-unix.txt,
93+
config-win.txt, or ~/.idle). A section is headed by the module name
94+
in square brackets, e.g.
95+
96+
[ZoomHeight]
97+
98+
The section may be empty, or it may define configuration options for
99+
the extension. (See ParenMatch.py for an example.) A special option
100+
is 'enable': including
101+
102+
enable = 0
103+
104+
in a section disables that extension. More than one configuration
105+
file may specify options for the same extension, so a user may disable
106+
an extension that is loaded by default, or enable an extension that is
107+
disabled by default.
94108

95109
Extensions can define key bindings and menu entries that reference
96110
events they don't implement (including standard events); however this is

0 commit comments

Comments
 (0)