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: Code cleanup on codecontext #77809

Closed
csabella opened this issue May 23, 2018 · 5 comments
Closed

IDLE: Code cleanup on codecontext #77809

csabella opened this issue May 23, 2018 · 5 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@csabella
Copy link
Contributor

BPO 33628
Nosy @terryjreedy, @csabella, @miss-islington
PRs
  • bpo-33628: IDLE: Minor code cleanup on codecontext  #7085
  • [3.7] bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085) #7091
  • [3.6] bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085) #7092
  • 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 2018-05-24.03:52:14.355>
    created_at = <Date 2018-05-23.23:48:33.096>
    labels = ['3.8', 'expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Code cleanup on codecontext'
    updated_at = <Date 2018-05-24.03:52:14.354>
    user = 'https://github.com/csabella'

    bugs.python.org fields:

    activity = <Date 2018-05-24.03:52:14.354>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2018-05-24.03:52:14.355>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2018-05-23.23:48:33.096>
    creator = 'cheryl.sabella'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33628
    keywords = ['patch']
    message_count = 5.0
    messages = ['317479', '317505', '317508', '317519', '317520']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['7085', '7091', '7092']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue33628'
    versions = ['Python 3.7', 'Python 3.8']

    @csabella
    Copy link
    Contributor Author

    Based on the github comments on PR5638, some code cleanup issues identified for codecontext.

    codecontext

    • getspacesfirstword - function and param1 name
    • get_line_info - make into helper function and change parm
    • get_context - call to get_line_info sends text instead of line number
    • toggle_code_context_event - move border calc to same loop at padx
    • cleanup some comments

    test_codecontext

    • test_get_line_info - move test to helper test class and change parm from line number to line
    • test_get_line_info - add test for tab (I noticed 'indent' is 1 when the regex matches to a tab. Even though IDLE doesn't allow tabs in the editor, I didn't want to lose track of this).
    • test_getspacesfirstword - function name
    • test_del - remove call to after info

    @csabella csabella added 3.7 (EOL) end of life 3.8 only security fixes labels May 23, 2018
    @csabella csabella added topic-IDLE type-feature A feature request or enhancement labels May 23, 2018
    @terryjreedy
    Copy link
    Member

    Super list. It made the diff really easy to parse into related changes. I printed it, reviewed code for items one by one, made a few changes, and checked them off when satisfied.

    IDLE *does* (sort of) allow tabs. One can read a file with tabs or Format => Tabify. Config-main.def still has 'use-spaces= 1' and I believe it is still read and acted on, at least in some places. (This is, of course, untested.) The option to turn it off on the dialog has been removed, but I believe it still could be turned off by hand-editing .idlerc/config-main.cfg. Of course, since 3.x rejects mixtures, beginners should expand tabs before editing existing files.

    I have thought about possibly reviewing the tab situation, but in the absence of people having problems with the status quo, it is very low priority. Maybe after 3.8 and the end of 2.x support.

    @terryjreedy
    Copy link
    Member

    New changeset 8506016 by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085)
    8506016

    @miss-islington
    Copy link
    Contributor

    New changeset 935c81b by Miss Islington (bot) in branch '3.6':
    bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085)
    935c81b

    @miss-islington
    Copy link
    Contributor

    New changeset b2ab5dc by Miss Islington (bot) in branch '3.7':
    bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085)
    b2ab5dc

    @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 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants