homepage

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: always display full grep path
Type: behavior Stage: test needed
Components: IDLE Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, eamanu, terry.reedy
Priority: normal Keywords:

Created on 2019年03月17日 02:48 by terry.reedy, last changed 2022年04月11日 14:59 by admin.

Messages (4)
msg338115 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019年03月17日 02:48
The second line of the Find in Files dialog is
 In files: [____________________________________]
When this is opened in the startup directory, Shell or an untitled editor, the entry starts as '*.py'. When this is opened in an titled editor file, the initial entry is the full path. A full path is much more useful and should always be given.
msg338118 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019年03月17日 04:52
To be more exact, if 'Find in Files' is called in an unsaved editor window, including Output windows, the the entry starts as '*.py'. I presume that this is relative to the current working directory, which is initially the startup directory. But this can change in an undocumented way. There is currently no way in a grep output to determine which directory was searched. This is especially annoying when there are no hits and one knows that there should be some.
My initial thought was to prefix '*.py' with the directory of sys.executable. os.getcwd() might be more useful. This would be in GrepDialog.open. This will still be untested after PR12203 for #23205.
Most of this method is self-free path manipulation that can be pulled into a module method and separately tested.
PR12203 adds os.curdir ('.') to no-directory patterns. After this issue, that will not be necessary unless a user deletes the explicit directory. I am pausing a PR for this issue until I finish reviewing that one and it is merged.
In the long run, I might like to separate the 'In files' glob path into 'Directory' and file glob pattern. (On Windows at least, glob patterns are not allowed in the directory part of the pattern.)
A related improvement would be listing the base search directory once at the top of output windows and not repeat it on every hit line. This would require revising the GoTo File/Line function.
msg338468 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019年03月20日 13:04
See also #21960. I'm going to close that one in favor of this issue.
msg338525 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019年03月21日 04:50
Thanks. I somehow never marked it for IDLE. Using groupby components, I discovered another +-10 and marked them and included in my list.
History
Date User Action Args
2022年04月11日 14:59:12adminsetgithub: 80504
2019年03月21日 04:50:10terry.reedysetmessages: + msg338525
2019年03月20日 13:04:55cheryl.sabellalinkissue21960 superseder
2019年03月20日 13:04:18cheryl.sabellasetmessages: + msg338468
2019年03月17日 12:47:22eamanusetnosy: + eamanu
2019年03月17日 04:52:43terry.reedysetnosy: + cheryl.sabella
messages: + msg338118
2019年03月17日 02:48:55terry.reedycreate

AltStyle によって変換されたページ (->オリジナル) /