Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-130693: Add options of the tkinter.Text.search method: -nolinestop -all -overlap -strictlimits#130848

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sharktide wants to merge8 commits intopython:main
base:main
Choose a base branch
Loading
fromsharktide:patch-130693

Conversation

sharktide
Copy link
Contributor

@sharktidesharktide commentedMar 4, 2025
edited by bedevere-appbot
Loading

Add options -nolinestop, -all, -overlap, and -strictlimits to the search function of the text class of tkinter.

Fixes#130693
Closes#130693

Tested against

.\PCbuild\amd64\python_d.exe -mtest -ugui test_tkinter

And test passed. Result:

0:00:00 [1/1] test_tkinter0:00:27 load avg: 3.93 [1/1] test_tkinter passed== Tests result: SUCCESS ==1test OK.Total duration: 27.6 secTotal tests: run=787 skipped=11Totaltest files: run=1/1Result: SUCCESS

Also tested against a custom test file:

import tkinter as tkroot = tk.Tk()text = tk.Text(root)text.pack()text.insert('1.0', 'This is a test. This is only a test.\nAnother line.\nYet another line.')# Test without optionsresult = text.search('test', '1.0', 'end')print('Without options:', result)# Test with -nolinestopresult = text.search('line', '1.0', 'end', nolinestop=True, regexp=True)print('With -nolinestop:', result)# Test with -allresult = text.search('test', '1.0', 'end', all=True)print('With -all:', result)# Test with -overlapresult = text.search('test', '1.0', 'end', overlap=True, all=True)print('With -overlap:', result)# Test with -strictlimitsresult = text.search('test', '1.0', 'end', strictlimits=True)print('With -strictlimits:', result)root.mainloop()

Which returns:

Without options: 1.10With -nolinestop: 2.8With -all: (<textindex object:'1.10'>,<textindex object:'1.31'>)With -overlap: (<textindex object:'1.10'>,<textindex object:'1.31'>)With -strictlimits: 1.10

Indicating that the new features are functioning correctly

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@sharktide
Copy link
ContributorAuthor

@ZeroIntensity Could someone please review? I think the original reviewer forgot

@sharktidesharktide requested a review fromWulian233May 5, 2025 15:49
@sharktide
Copy link
ContributorAuthor

@Wulian233 Please Review again

@sharktide
Copy link
ContributorAuthor

I am currently pinging this PR as I have not seen a review in nearly a month.
Could someone please review?

@sharktide
Copy link
ContributorAuthor

sharktide commentedMay 30, 2025 via email

On it
On Fri, May 30, 2025 at 13:22 Peter Bierma ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In Misc/NEWS.d/next/Library/2025-03-04-17-19-26.gh-issue-130693.Kv01r8.rst <#130848 (comment)>: > @@ -0,0 +1,6 @@ +================ +Type: Enhancement We don't need this metadata. — Reply to this email directly, view it on GitHub <#130848 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BNITW52CNI3C5F6RICJESQD3BCHTXAVCNFSM6AAAAABYKCKEFWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQOBRHE2TMNRRHE> . You are receiving this because you authored the thread.Message ID: ***@***.***>

@sharktide
Copy link
ContributorAuthor

Done!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Wulian233Wulian233Awaiting requested review from Wulian233

@ZeroIntensityZeroIntensityAwaiting requested review from ZeroIntensity

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

tkinter missing -nolinestop on tk.Text
3 participants
@sharktide@ZeroIntensity@Wulian233

[8]ページ先頭

©2009-2025 Movatter.jp