#36 Squeezer - an extension to turn long outputs into buttons


When this extension is active, it wraps the write
method of a PyShell instance so that if a long output
is to be printed, a button will be inserted into the
Text widget. The output could then be previewed in an
external viewer (such as less), and could be expanded
back to a normal text. Also, existing outputs can be
squeezed into such a button by using a command from the
right-click menu.

The files attached are:
- the extension module
- its configuration options in config-extensions.def
- a small fix to configHandler.py, to disable
ConfigParser's format-strings feature. This feature,
which lets you specify configuration strings which
relate to other configuration strings, is not used in
IDLEfork currently, and doesn't let me pass my own
format strings in the configuration string. I need them
because the command to start the viewer should have a
place for the temporary file which contains the text -
for example, this is the configuration string for linux:
preview-command-posix=(xterm -e less %(fn)s; rm -f
%(fn)s) &
Note that configuration strings are used currently for
specifying the printing command, but no problem arises
because they are unnamed.


  • This is an updated version - I fixed a tiny thing.