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 grep/find/replace source code needs docstrings #67405

Closed
AlSweigart mannequin opened this issue Jan 10, 2015 · 6 comments
Closed

IDLE grep/find/replace source code needs docstrings #67405

AlSweigart mannequin opened this issue Jan 10, 2015 · 6 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@AlSweigart
Copy link
Mannequin

AlSweigart mannequin commented Jan 10, 2015

BPO 23216
Nosy @terryjreedy, @csabella, @miss-islington
PRs
  • bpo-23216: IDLE: Add docstrings to search modules #12141
  • [3.7] bpo-23216: IDLE: Add docstrings to search modules (GH-12141) #12376
  • Files
  • idle_docstrings.diff: Patch with new docstrings.
  • 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/csabella'
    closed_at = <Date 2019-03-16.23:54:36.516>
    created_at = <Date 2015-01-10.09:15:06.167>
    labels = ['3.8', 'expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE grep/find/replace source code needs docstrings'
    updated_at = <Date 2019-03-16.23:54:36.515>
    user = 'https://bugs.python.org/AlSweigart'

    bugs.python.org fields:

    activity = <Date 2019-03-16.23:54:36.515>
    actor = 'cheryl.sabella'
    assignee = 'cheryl.sabella'
    closed = True
    closed_date = <Date 2019-03-16.23:54:36.516>
    closer = 'cheryl.sabella'
    components = ['IDLE']
    creation = <Date 2015-01-10.09:15:06.167>
    creator = 'Al.Sweigart'
    dependencies = []
    files = ['37663']
    hgrepos = []
    issue_num = 23216
    keywords = ['patch']
    message_count = 6.0
    messages = ['233807', '336440', '337022', '337963', '338110', '338113']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'Al.Sweigart', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['12141', '12376']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue23216'
    versions = ['Python 3.7', 'Python 3.8']

    @AlSweigart
    Copy link
    Mannequin Author

    AlSweigart mannequin commented Jan 10, 2015

    The following IDLE files need docstrings for their methods:

    GrepDialog.py
    SearchEngine.py
    SearchDialogBase.py
    SearchDialog.py
    ReplaceDialog.py

    @AlSweigart AlSweigart mannequin added topic-IDLE type-feature A feature request or enhancement labels Jan 10, 2015
    @terryjreedy
    Copy link
    Member

    Current module names, docstring status, and note.

    grep - present, some args not doc'ed
    replace - spotty; do not repetively doc 'event=None' args
    search - ditto
    searchbase - present
    searchengine - present; do not separately docstring 'isxyz' wrappers

    Closing """ must be on line by itself.

    Parts of the patch should be usable at least as 'first drafts' for filling in missing docstrings. I am not sure whether better to edit diff (maybe after splitting into diffs for each module) and apply (I have never done this with git) or to edit modules directly.

    Cheryl, another one you might want to grab.

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 (EOL) end of life labels Feb 24, 2019
    @csabella csabella self-assigned this Feb 24, 2019
    @csabella
    Copy link
    Contributor

    csabella commented Mar 3, 2019

    I've created the first PR for docstrings on replace. Saimadhav Heblikar had added some docstrings under bpo-21676, so I expanded on what he did. I referred to Al's diff, but didn't use it much since there were already some docstrings.

    For readability, I also changed some boolean values from 0 to False and 1 to True. I had to figure out what ok did, so that helped.

    I also left a note in `show_hit` because it isn't working right.  The text gets colorized with the `sel` tag instead of the `hit` tag.  effbot says this about tag ordering:
    >>> If you attach multiple tags to a range of text, style options from the most recently created tag override options from earlier tags. In the following example, the resulting text is blue on a yellow background.

    >> text.tag_config("n", background="yellow", foreground="red")
    >> text.tag_config("a", foreground="blue")
    >> text.insert(contents, ("n", "a"))

    >> Note that it doesn’t matter in which order you attach tags to a range; it’s the tag creation order that counts.

    The note seems to be the important part here as the definition for sel is done before hit in colorizer.

    @terryjreedy
    Copy link
    Member

    There are several minor things to fix after this (and multiple issues), including the difference between find in search and replace. It seems to me that is should be the same. We will definitely need to test changes on both Windows and Linux.

    The font color issue is essentially the one that resulted in white on white in the completions box. We should always set both foreground and background to make sure consistent. Another nit for followup.

    @csabella
    Copy link
    Contributor

    New changeset 0bb5e75 by Cheryl Sabella in branch 'master':
    bpo-23216: IDLE: Add docstrings to search modules (GH-12141)
    0bb5e75

    @miss-islington
    Copy link
    Contributor

    New changeset b34f1aa by Miss Islington (bot) in branch '3.7':
    bpo-23216: IDLE: Add docstrings to search modules (GH-12141)
    b34f1aa

    @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 (EOL) end of life topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants