Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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 Text213 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 addfrom idlelib.colorizer import setup_colorizer
andsetup_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