summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/percolator.py
diff options
context:
space:
mode:
authorTal Einat <532281+taleinat@users.noreply.github.com>2021-04-28 22:27:55 (GMT)
committerGitHub <noreply@github.com>2021-04-28 22:27:55 (GMT)
commit15d386185659683fc044ccaa300aa8cd7d49cc1a (patch)
tree6fac7df4ac125b39648d8f0d7fbb008212dc6ba8 /Lib/idlelib/percolator.py
parent103d5e420dd90489933ad9da8bb1d6008773384d (diff)
downloadcpython-15d386185659683fc044ccaa300aa8cd7d49cc1a.zip
cpython-15d386185659683fc044ccaa300aa8cd7d49cc1a.tar.gz
cpython-15d386185659683fc044ccaa300aa8cd7d49cc1a.tar.bz2
bpo-37903: IDLE: Shell sidebar with prompts (GH-22682)
The first followup will change shell indents to spaces. More are expected. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/percolator.py')
-rw-r--r--Lib/idlelib/percolator.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/idlelib/percolator.py b/Lib/idlelib/percolator.py
index db70304..1fe34d2 100644
--- a/Lib/idlelib/percolator.py
+++ b/Lib/idlelib/percolator.py
@@ -38,6 +38,21 @@ class Percolator:
filter.setdelegate(self.top)
self.top = filter
+ def insertfilterafter(self, filter, after):
+ assert isinstance(filter, Delegator)
+ assert isinstance(after, Delegator)
+ assert filter.delegate is None
+
+ f = self.top
+ f.resetcache()
+ while f is not after:
+ assert f is not self.bottom
+ f = f.delegate
+ f.resetcache()
+
+ filter.setdelegate(f.delegate)
+ f.setdelegate(filter)
+
def removefilter(self, filter):
# XXX Perhaps should only support popfilter()?
assert isinstance(filter, Delegator)