classification
Title: IDLE grep/find/replace source code needs docstrings
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: cheryl.sabella Nosy List: Al.Sweigart, cheryl.sabella, miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2015-01-10 09:15 by Al.Sweigart, last changed 2019-03-16 23:54 by cheryl.sabella. This issue is now closed.

Files
File name Uploaded Description Edit
idle_docstrings.diff Al.Sweigart, 2015-01-10 09:15 Patch with new docstrings. review
Pull Requests
URL Status Linked Edit
PR 12141 merged cheryl.sabella, 2019-03-03 00:43
PR 12376 merged miss-islington, 2019-03-16 23:29
Messages (6)
msg233807 - (view) Author: Al Sweigart (Al.Sweigart) * Date: 2015-01-10 09:15
The following IDLE files need docstrings for their methods:

GrepDialog.py
SearchEngine.py
SearchDialogBase.py
SearchDialog.py
ReplaceDialog.py
msg336440 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-02-24 06:31
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.
msg337022 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-03-03 00:52
I've created the first PR for docstrings on replace.  Saimadhav Heblikar had added some docstrings under issue 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.
msg337963 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-03-15 03:46
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.
msg338110 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-03-16 23:29
New changeset 0bb5e75cf8bc9b197ffb91cba6f30543ed502708 by Cheryl Sabella in branch 'master':
bpo-23216: IDLE: Add docstrings to search modules (GH-12141)
https://github.com/python/cpython/commit/0bb5e75cf8bc9b197ffb91cba6f30543ed502708
msg338113 - (view) Author: miss-islington (miss-islington) Date: 2019-03-16 23:47
New changeset b34f1aa81433d60aee7bd744352b347dd650ca84 by Miss Islington (bot) in branch '3.7':
bpo-23216: IDLE: Add docstrings to search modules (GH-12141)
https://github.com/python/cpython/commit/b34f1aa81433d60aee7bd744352b347dd650ca84
History
Date User Action Args
2019-03-16 23:54:36cheryl.sabellasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-03-16 23:47:30miss-islingtonsetnosy: + miss-islington
messages: + msg338113
2019-03-16 23:29:45miss-islingtonsetstage: needs patch -> patch review
pull_requests: + pull_request12336
2019-03-16 23:29:35cheryl.sabellasetmessages: + msg338110
2019-03-15 03:46:19terry.reedysetmessages: + msg337963
2019-03-03 00:52:10cheryl.sabellasetmessages: + msg337022
stage: patch review -> needs patch
2019-03-03 00:43:50cheryl.sabellasetstage: needs patch -> patch review
pull_requests: + pull_request12142
2019-02-24 20:18:11cheryl.sabellasetassignee: cheryl.sabella
2019-02-24 06:31:59terry.reedysetversions: + Python 3.7, Python 3.8, - Python 2.7, Python 3.4, Python 3.5
nosy: + cheryl.sabella

messages: + msg336440

stage: patch review -> needs patch
2015-01-11 16:04:15berker.peksagsetnosy: + terry.reedy

stage: patch review
2015-01-11 04:06:50Al.Sweigartsetversions: + Python 2.7, Python 3.4
2015-01-10 09:15:06Al.Sweigartcreate