classification
Title: IDLE - Percolator overhaul
Type: behavior Stage: patch review
Components: IDLE Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: kbk Nosy List: gpolo, kbk, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2007-10-10 02:17 by taleinat, last changed 2010-07-21 09:26 by taleinat.

Files
File name Uploaded Description Edit
IDLE_Percolator.071010.patch taleinat, 2007-10-10 02:17 review
Messages (6)
msg56306 - (view) Author: Tal Einat (taleinat) (Python committer) Date: 2007-10-10 02:17
The Percolator class has been very hard to figure out, and has been a
source of confusion for users wanting to "hack" IDLE.

This patch makes Percolator a generally useful class which inherits from
Delegator. It also adds a new class, TkTextPercolator, which inherits
from Percolator and does all of the Text widget specific stuff.

The code has been refactored, cleaned up, and the in-code comments have
been improved. UndoDelegator.py, ColorDelegator.py and EditorWindow.py
have been updated as needed.

Also, the code using ColorDelegator in EditorWindow.py has been slightly
modified to work better with the Percolator.

I've done some testing (only on WinXP but nothing here is platform
specific) and this seems to work without a hitch.

This patch is required for the Squeezer and ShellLogger IDLE extensions
found on PyPI to be able to co-exist.
msg56308 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-10 03:21
It's been too long since I wrote this code to be able to review, but I'm
glad that it still gets some love and attention.  Here's to hoping that
your patch gets applied.
msg56448 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-10-15 16:25
Thanks for the patch, it will definitely be applied once I
finish reviewing it!  Good job splitting off TkTextPercolator
and inheriting from Delegator.
msg56653 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-10-22 18:08
What change was required to allow Squeezer and ShellLogger
to co-exist?
msg56680 - (view) Author: Tal Einat (taleinat) (Python committer) Date: 2007-10-23 13:49
The change required for Squeezer and ShellLogger is the separation of
the Tk Text specific logic into a subclass, which makes Percolator a
generally useful class. Along with the simple patch to Delegator.py
which allows delegation to callables, this change allows one to replace
a method with a Percolator instance.

I want to do this for EditorWindow.write, since both Squeezer and
ShellLogger need to hook onto this call somehow. Furthermore,
ShellLogger must catch this call before Squeezer does, since Squeezer
may change the output, but the original output should pass through
ShellLogger first.

Since there is no way to control the order in which extensions are
loaded, this constraint must be enforced by the extensions themselves.
Using the patched Percolator is the simplest way I could come up with to
support this. (IMHO adding a constraint solver for extensions at this
point would be overkill.)
msg111026 - (view) Author: Tal Einat (taleinat) (Python committer) Date: 2010-07-21 09:26
Note that at one point discussion of this issue was continued on the tracker page for issue1252.
History
Date User Action Args
2010-07-21 09:26:45taleinatsetmessages: + msg111026
2010-07-21 02:41:11BreamoreBoysetnosy: + terry.reedy, - gvanrossum
versions: + Python 3.2, - Python 2.6
2009-04-26 22:25:33ajaksu2setnosy: + gpolo
versions: + Python 3.1, Python 2.7, - Python 2.5

stage: patch review
2007-10-23 13:49:33taleinatsetmessages: + msg56680
2007-10-22 18:08:36kbksetmessages: + msg56653
2007-10-15 16:25:32kbksetpriority: normal
assignee: kbk
messages: + msg56448
2007-10-10 06:03:12loewissetkeywords: + patch
2007-10-10 03:21:52gvanrossumsetnosy: + gvanrossum
messages: + msg56308
2007-10-10 02:17:04taleinatcreate