Skip to content

bpo-27115: Use Query subclass for IDLE editor Goto#18871

Merged
terryjreedy merged 9 commits into
python:masterfrom
terryjreedy:gotobox
Mar 9, 2020
Merged

bpo-27115: Use Query subclass for IDLE editor Goto#18871
terryjreedy merged 9 commits into
python:masterfrom
terryjreedy:gotobox

Conversation

@terryjreedy
Copy link
Copy Markdown
Member

@terryjreedy terryjreedy commented Mar 9, 2020

Replace tkinter tkSimpleDialog.askinteger with IDLE query dialog.
The new box checks for positivity before returning.

https://bugs.python.org/issue27115

Comment thread Lib/idlelib/query.py Outdated
"Get a positive line number for editor Go To Line."
# Used in editor.EditorWindow.goto_line_event.

def __init__(self, parent, title, message, *, _htest=False, _utest=False):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This __init__ seems unnecessary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I copied and edited from an existing subclass that does need it. Deleted.

Comment thread Lib/idlelib/editor.py
text.bell()
return "break"

lineno = query.Goto(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this behave correctly when simply closing the dialog?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Cursor stays put but selection is erroneously cleared. Fixed.

Comment thread Lib/idlelib/NEWS.txt Outdated
======================================


bpo-27115: For Edit Go to Line, use a Query entry box subclass with
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Edit Go to Line" is a bit awkward; IMO "Go to Line" is sufficient and clearer.

(Relevant to the NEWS entry as well.)

Copy link
Copy Markdown
Member Author

@terryjreedy terryjreedy Mar 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Thank you for the comments.

@terryjreedy terryjreedy merged commit 363fab8 into python:master Mar 9, 2020
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@terryjreedy terryjreedy deleted the gotobox branch March 9, 2020 20:51
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
@bedevere-bot
Copy link
Copy Markdown

GH-18886 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link
Copy Markdown

GH-18887 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants