Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add test_turtledemo for colorizer in turtledemo #104428

Copy link
Copy link
Open
@terryjreedy

Description

@terryjreedy
Issue body actions

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

Labels

stdlibPython modules in the Lib dirPython modules in the Lib dirtestsTests in the Lib/test dirTests in the Lib/test dirtopic-IDLE

Projects

Status

No status
Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.