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: Can IDLE's query box be improved
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: kbk, markroseman, roger.serwy, terry.reedy
Priority: normal Keywords:

Created on 2015-08-13 20:02 by markroseman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
querydialog.png markroseman, 2015-08-14 00:53
querydialog.py markroseman, 2015-08-14 01:36
Messages (7)
msg248539 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-13 20:02
In EditorWindow.open_module... once switch to querydialog, display errors (e.g. module not found) in askstring dialog itself, not open up subsequent 'showerror' dialog
msg248543 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-13 23:29
I see this as two related changes:

a) Leave the module name query box open when there is a error, so the user can either correct a mistake (or hit Cancel) without reopening the box and re-entering the module name.  Good idea.

b) Put the error message in the box itself, perhaps with a beep.  I presume there would be no [OK] button, but rather the cursor would remain in the entry box.  Nice simplification.

I believe 'not a source-based module' means 'not a python-coded module', which seems a little clearer. We could check the importlib doc.
msg248547 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-14 00:53
Exactly. The "querydialog" code (which will replace the simpledialog askstring/askinteger calls) displays errors as shown in querydialog.png, with the error messages disappearing as soon as you hit another key.

You can also pass in a 'validator' to check if the input is ok, so in this case it would check if the module could be loaded and return the appropriate message if not.
msg248548 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-14 01:13
Where is querydialog? (It looks like something than should be in tkinter ;-).
msg248550 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-14 01:36
Work in progress, have a few more tweaks to make, but here's a snapshot...
msg296678 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-23 05:25
The patch is mostly obsolete.  I added query.py a year ago, which replaced the open-module box and those used in configdialog.  The code began with one of the existing boxes, but it has the two improvements listed above: a) stay open on error (really helpful if I type 'idlelib.run' and only need to correct one letter) and b) put error message below entry box.

I am leaving this open temporarily to see if there is anything in this patch needed in Query.
msg370917 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-07 22:11
Thanks for the push.  query.py now has several subclasses which I believe covers all simple queries.
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 69048
2020-06-07 22:11:13terry.reedysetstatus: open -> closed
resolution: out of date
messages: + msg370917

stage: patch review -> resolved
2017-06-23 05:25:47terry.reedysetassignee: terry.reedy
2017-06-23 05:25:35terry.reedysettitle: handling of IDLE 'open module' errors -> Can IDLE's query box be improved
stage: needs patch -> patch review
messages: + msg296678
versions: + Python 3.7, - Python 2.7, Python 3.5
2015-08-14 01:36:39markrosemansetfiles: + querydialog.py

messages: + msg248550
2015-08-14 01:13:36terry.reedysetmessages: + msg248548
2015-08-14 00:53:39markrosemansetfiles: + querydialog.png

messages: + msg248547
2015-08-13 23:30:00terry.reedysetmessages: + msg248543
stage: needs patch
2015-08-13 20:02:23markrosemancreate