This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: document new TabPage(Frame) design for configdialog
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, terry.reedy
Priority: normal Keywords:

Created on 2017-07-30 21:50 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2965 merged cheryl.sabella, 2017-08-01 00:08
PR 2965 merged cheryl.sabella, 2017-08-01 00:08
PR 2973 merged terry.reedy, 2017-08-01 04:29
Messages (4)
msg299524 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-30 21:50
We are in the process of moving blocks of ConfigDialog methods pertaining to one tab page to a separate class. FontPage is more or less done.  GenPage is in process.  This issue is about documenting the generic structure of the classes in a comment block.  The following is extracted from msg299519 of #31050.

# class TabPage(Frame):
#    def __init__(self, master):
#        super().__init__(master)
#        self.create_page_tab()
#        self.load_tab_cfg()
#    def create_page_tab():
# ...
 
The rest will be an adaptation of the description of the old design in the same message plus what we have actually done so far.

This issue includes editing FontPage to conform to the documented design.
msg299595 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-01 04:24
New changeset 6f446bee4f6ac0c61bb2c3386a0149fd36855793 by Terry Jan Reedy (csabella) in branch 'master':
bpo-31083: IDLE: Describe the Page classes in configdialog (#2965)
https://github.com/python/cpython/commit/6f446bee4f6ac0c61bb2c3386a0149fd36855793
msg299597 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-01 05:00
New changeset 48fcc72c83e1b47b200dd39f9dcc9f62fa0d4d17 by Terry Jan Reedy in branch '3.6':
[3.6] bpo-31083: IDLE: Describe the Page classes in configdialog (GH-2965) (#2973)
https://github.com/python/cpython/commit/48fcc72c83e1b47b200dd39f9dcc9f62fa0d4d17
msg299599 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-01 05:27
The next blockers are the tests for the other 3 tabs: #31001, #31002, #31093.  

Steps for converting block of ConfigDialog methods for tab X into a class.  Steps are updated from #31050.

* In create_widgets, change 'self.create_page_/highlight/keys/extensions/' to '/High/Keys/Ext/Page(note)'.
* In load_configs, comment-out load_X_cfgs.  If there is no problem moving all these calls into the class inits, method will be deleted.
* Copy the block for X into its appropriate position after class FontPage.
* Comment out old code.
* Before the copy, add 'class XPage(Frame):' and def __init__ as given in the outline.
* In the 'create_page_x' method, at the top, Pass 'self' instead of 'parent' as tk Var masters;
* delete 'frame = dialog.tabpages...';
* replace 'frame' with 'self' as master for widgets that used 'frame';
* delete 'return frame' at end.

After tests pass with revision above, delete original block of methods.

I have considered doing this before writing tests, but I don't quite feel comfortable doing so.  To convert tests written first:

* change 'XTest' to 'XPageTest' where 2nd X is abbreviated form.
* change setUpClass similarly as in FontPageTest;
* change test functions similarly as in FontPageTest; change 'dialog' to 'self.page' and 'd = dialog' to 'd = self.page'.
* make other changes needed to keep tests passing, but there may not be any more changes needed.
History
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75266
2017-08-01 05:28:04terry.reedysetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2017-08-01 05:27:27terry.reedysetmessages: + msg299599
2017-08-01 05:00:37terry.reedysetmessages: + msg299597
2017-08-01 04:29:03terry.reedysetpull_requests: + pull_request3018
2017-08-01 04:24:09terry.reedysetmessages: + msg299595
2017-08-01 00:08:32cheryl.sabellasetpull_requests: + pull_request3012
2017-08-01 00:08:24cheryl.sabellasetpull_requests: + pull_request3013
2017-07-30 21:50:03terry.reedycreate