Open
Description
A colorizer change could potentially break the use of colorizer in turtledemo.main. Relevant code:
92 from idlelib.colorizer import ColorDelegator, color_config
93 from idlelib.percolator import Percolator
# __init__ creates root and on line 166 calls makeTextFrame
# makeTextFrame(self, root) (line 211) makes a Frame and then a Text
213 self.text = text = Text(text_frame, ...
215 color_config(text)
# After call to makeTextFrame() in def __init__().
195 Percolator(self.text).insertfilter(ColorDelegator())
The Percolator call can and should follow the color_config call. I propose to move the imports and those two lines to a new setup_colorizer(text) function in colorizer.py. Next add from idlelib.colorizer import setup_colorizer
and setup_colorizer(text)
to turtledemo. Then add a simple test of setup_colorizer to test_colorizer: create root, add Text, setup_colorizer, add some text with special items, and check that they are tagged. Branch is colordemo.
Metadata
Metadata
Assignees
Projects
Status
No status