Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: Document tk Vars, attributes, methods by tab page #75096

Closed
terryjreedy opened this issue Jul 12, 2017 · 11 comments
Closed

IDLE: Document tk Vars, attributes, methods by tab page #75096

terryjreedy opened this issue Jul 12, 2017 · 11 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 30913
Nosy @terryjreedy, @mlouielu, @csabella
PRs
  • bpo-30913: IDLE: Document tk vars, attributes, and methods for configdialog #2697
  • [3.6] bpo-30913: IDLE: Document tk vars, attributes, and methods for … #2702
  • Files
  • docstrings1.txt
  • configdialog_funcs.txt: Potential class each function would go to
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2017-07-14.03:36:34.673>
    created_at = <Date 2017-07-12.20:10:51.036>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Document tk Vars, attributes, methods by tab page'
    updated_at = <Date 2017-07-14.16:50:29.598>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2017-07-14.16:50:29.598>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2017-07-14.03:36:34.673>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2017-07-12.20:10:51.036>
    creator = 'terry.reedy'
    dependencies = []
    files = ['47008', '47013']
    hgrepos = []
    issue_num = 30913
    keywords = []
    message_count = 11.0
    messages = ['298244', '298247', '298250', '298254', '298261', '298329', '298331', '298332', '298334', '298355', '298361']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'louielu', 'cheryl.sabella']
    pr_nums = ['2697', '2702']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30913'
    versions = ['Python 3.6', 'Python 3.7']

    @terryjreedy
    Copy link
    Member Author

    Among other things, bpo-30777 added docstrings to configdialog. Those for create_page_x methods included a list of 'Configuration attributes' (Tk Variables) with an annotation as to what the Var represents. The list for the font tab already helped when writing tests for the tab.

    Although the list is redundant with the code, and creates a slight maintenance problem if names are changed, I want to add more lists. The information collected together will be helpful even if not 100% perfect. Beside tests, it will help with configdialog maintenance and refactoring, including extracting more classes from ConfigDialog.

    Rename 'Configuration attributes' to 'Tk Variables'. For each page, add 'Data attributes' (other than the Vars). The annotation can briefly say what it is. Add 'Methods' (other than the tk var trace methods) related to that one page and if needed, *briefly* what it does (not the whole first line of its docstring). Add 'Widgets bound to self' and the widget class. Most widget names are not bound to self; the ones that are should be the ones that need to be referenced elsewhere, whether in other methods or tests.

    Expand the single line docstring for create_action_buttons as appropriate. Date attributes include globals help_common and help_pages. Methods include the click handlers. I would like a note on what outside data structure is accessed by the click handlers.

    Expand the single line create_widgets docstring to include multi-page information. 'Page interactions' would have things like "Font vars trigger redrawing of highlights sample text." Such interactions will have to be accounted for if we create page classes. 'Tracer Methods' would include the methods that affect all tracer methods. 'Other methods' should include anything else, unless addition methods groups are defined.

    ConfigDialog currently has 71 methods defined by def statements. (There is 1 nested def in ConfigDialog and 4 other defs at the end of the file for 76 total in the file.) I would like all 64 methods other than __init__ and the 6 create_ methods to be accounted for in 1 of the 6 create_ docstrings. I expect this issue to have multiple PRs.

    @terryjreedy terryjreedy self-assigned this Jul 12, 2017
    @terryjreedy terryjreedy added topic-IDLE type-feature A feature request or enhancement 3.7 (EOL) end of life labels Jul 12, 2017
    @csabella
    Copy link
    Contributor

    I had actually started doing this a little in the original docstrings and then was worried that it was too redundant with the code.

    Thanks for mentioning the multiple PRs. I'll take a look at it and make one change at a time for easier review.

    @terryjreedy
    Copy link
    Member Author

    You put one non-tk name in the font page 'Configuration attributes'. I removed it as not belonging with the tk Vars, but it got me thinking that more would be useful. In the ConfigChanges docstring we included a list of methods, which I believe is recommended even if not always done. If we turn the check_ functions into classes, their docstrings become the class docstrings. The check_ body would be turned into and __init__ body and the list of methods would the methods that need to be moved into the new class.

    @csabella
    Copy link
    Contributor

    I did a first draft of the four create_page_* methods. I did one additional section called 'Widget Structure' which has the names of the widgets indented under the parent widget they are attached to. I don't know if that would be helpful. The order of the code already mostly follows the structure.

    @terryjreedy
    Copy link
    Member Author

    16 methods so far, + 17 var_changed_x is 35, leaving another 29.

    If you are going to give the whole widget structure, then an '*' before bound names would be sufficient and avoid the duplication.

    @terryjreedy
    Copy link
    Member Author

    I added missing functions and created attached list with help of Find in (1) Files.

    @terryjreedy
    Copy link
    Member Author

    New changeset 36329a4 by terryjreedy (csabella) in branch 'master':
    bpo-30913: IDLE: Document tk vars, attributes, and methods for ConfigDialog (bpo-2697)
    36329a4

    @terryjreedy
    Copy link
    Member Author

    We can edit details as we examine functions to test and change or refactor.

    @terryjreedy
    Copy link
    Member Author

    New changeset 9a09c66 by terryjreedy in branch '3.6':
    [3.6] bpo-30913: IDLE: Document tk vars, attributes, and methods for ConfigDialog (GH-2697) (bpo-2702)
    9a09c66

    @csabella
    Copy link
    Contributor

    Did you want me to do other PRs for this? I had intended that one to be the first and I would complete more information on a subsequent PR, but you've added a lot of info.

    @terryjreedy
    Copy link
    Member Author

    If you have more annotations to add now, go ahead and I will review.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants