bpo-31050: IDLE: Factor GenPage class from ConfigDialog#2952
bpo-31050: IDLE: Factor GenPage class from ConfigDialog#2952terryjreedy merged 2 commits intopython:masterpython/cpython:masterfrom
Conversation
terryjreedy
left a comment
There was a problem hiding this comment.
Add blurb with
bpo-31004: Factor FontPage(Frame) class from ConfigDialog.
The slightly modified tests continue to pass.
Patch by Cheryl Sabella.
Lib/idlelib/configdialog.py
Outdated
|
|
||
| def __init__(self, parent): | ||
| super().__init__(parent) | ||
| self.parent = parent |
There was a problem hiding this comment.
Delete unneeded line. See below.
Lib/idlelib/configdialog.py
Outdated
| (*)helplist: ListBox | ||
| scroll_helplist: Scrollbar | ||
| """ | ||
| parent = self.parent |
There was a problem hiding this comment.
Delete and replace 'parent' with 'self' in the 4 statements below.
Lib/idlelib/configdialog.py
Outdated
|
|
||
| # Create widgets: | ||
| # body and section frames. | ||
| frame = self |
There was a problem hiding this comment.
Delete and carefully replace '(frame,' with '(self,' in the next four statements. (I believe that these are the only one that need it.)
Lib/idlelib/configdialog.py
Outdated
| self.button_helplist_add.pack(side=TOP, anchor=W) | ||
| self.button_helplist_remove.pack(side=TOP, anchor=W, pady=5) | ||
|
|
||
| return frame |
Lib/idlelib/configdialog.py
Outdated
| StringVar(parent), ('main', 'EditorWindow', 'height')) | ||
|
|
||
| # Create widgets: | ||
| # body and section frames. |
Lib/idlelib/configdialog.py
Outdated
| # for num in range(1, len(self.user_helplist) + 1): | ||
| # changes.add_option( | ||
| # 'main', 'HelpFiles', str(num), | ||
| # ';'.join(self.user_helplist[num-1][:2])) |
There was a problem hiding this comment.
With tests passing, delete the entire commented out block above.
| page.upc = page.update_help_changes = Func() | ||
|
|
||
| @classmethod | ||
| def tearDownClass(cls): |
There was a problem hiding this comment.
Add 'page = cls.page' and simplify next 4 lines.
Lib/idlelib/configdialog.py
Outdated
| note.add(self.keyspage, text=' Keys ') | ||
| note.add(self.genpage, text=' General ') | ||
| note.add(self.extpage, text='Extensions') | ||
| note.add(self.fontpage, text='Fonts/Tabs', underline=0) |
There was a problem hiding this comment.
Revert the underline additions.
terryjreedy
left a comment
There was a problem hiding this comment.
I tested each widget on the page and checked that the corresponding change had been made in my user config-main. (Automating this would be the subject of a #24845 spinoff.)
https://bugs.python.org/issue31050