Skip to content

Conversation

@Wulian233
Copy link
Contributor

@Wulian233Wulian233 commented Aug 29, 2024

In addition to fixing this bug, I also made some changes.

  1. The second hand was shorter than the minute hand, which was incorrect, and this has now been fixed. (minute hand 130 → 115)
  2. Remove the first line's coding: cp1252, as this file has always been utf8.
2024-08-29 0938472024-08-29 093936

Copy link
Member

@terryjreedyterryjreedy left a comment

Choose a reason for hiding this comment

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

Nice. Needs one change and one question answered. I also need to verify that we can remove functions. I suggested other changes on issue for other PR/issue.

@bedevere-app
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@terryjreedyterryjreedy changed the title gh-123370: Fix the canvas not clearing after running turtledemo clock and improve the clock example suitegh-123370: Fix the canvas not clearing after running turtledemo.clockAug 31, 2024
@Wulian233
Copy link
ContributorAuthor

Wulian233 commented Sep 1, 2024

I have made the requested changes; please review again
The time is now dynamically updated, and the date is refreshed only once when the day changes. The cause of this bug is that the text was being refreshed every second 🚀 🕙

bandicam.2024-09-01.19-56-12-916.mp4

@bedevere-app
Copy link

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@bedevere-app
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Wulian233
Copy link
ContributorAuthor

Wulian233 commented Sep 4, 2024

I have made the requested changes; please review again

Thank you for your review again. In the previous clock.py, the parameters used in the calls to the functions datum(z) and wochentag(t) were t = datetime.today(). These functions return the date (such as month, day, year) or the day of the week

https://github.com/python/cpython/blob/main/Lib/turtledemo/clock.py#L82-L93

https://github.com/python/cpython/blob/main/Lib/turtledemo/clock.py#L105-L105

Now wochentag and datum functions now ensure that the parameters and functionality are same (Because both use the datetime module)

defwochentag(t): returnt.strftime(format="%A") defdatum(z): returnz.strftime(format="%Y/%m/%d")

@bedevere-app
Copy link

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@terryjreedy
Copy link
Member

You reverted more than I requested, but moving the other changes, which I do want, to a separate cleanup/modernize backported PR is fine.

@terryjreedyterryjreedy added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Oct 17, 2024
@miss-islington-app
Copy link

Thanks @Wulian233 for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @Wulian233 for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @Wulian233 and @terryjreedy, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker c124577ebe915a00de4033c0f7fa7c47621d79e0 3.12 

@terryjreedyterryjreedy added the type-bug An unexpected behavior, bug, or error label Oct 17, 2024
@miss-islington-app
Copy link

Sorry, @Wulian233 and @terryjreedy, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker c124577ebe915a00de4033c0f7fa7c47621d79e0 3.13 

@terryjreedyterryjreedy removed the type-bug An unexpected behavior, bug, or error label Oct 17, 2024
terryjreedy pushed a commit to terryjreedy/cpython that referenced this pull request Oct 17, 2024
…tledemo.clock (pythonGH-123457) Rewriting the day and date every tick somehow prevented them from being removed either by clicking STOP or loading another example. The solution is to rewrite them only when they change. (cherry picked from commit c124577) Co-authored-by: Wulian <[email protected]>
@terryjreedy
Copy link
Member

terryjreedy commented Oct 17, 2024

Merge conflict explained at #118673 (comment). This will impact (edit) docstring changes in the rest of turtledemo files. I have fixed this one for 3.13 and will backport that PR.

@bedevere-app
Copy link

GH-125653 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Oct 17, 2024
@pythonpython deleted a comment from bedevere-appbotOct 17, 2024
@terryjreedyterryjreedy removed the needs backport to 3.12 only security fixes label Oct 17, 2024
terryjreedy added a commit that referenced this pull request Oct 17, 2024
…o.clock (gh-123457) (#125653) [3.13] gh-123370: Fix the canvas not clearing after running turtledemo.clock (GH-123457) Rewriting the day and date every tick somehow prevented them from being removed either by clicking STOP or loading another example. The solution is to rewrite them only when they change. (cherry picked from commit c124577) Co-authored-by: Wulian <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 17, 2024
…tledemo.clock (pythongh-123457) (pythonGH-125653) [3.13] pythongh-123370: Fix the canvas not clearing after running turtledemo.clock (pythonGH-123457) Rewriting the day and date every tick somehow prevented them from being removed either by clicking STOP or loading another example. The solution is to rewrite them only when they change. (cherry picked from commit c124577) (cherry picked from commit 30d7e9e) Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Wulian <[email protected]>
terryjreedy added a commit that referenced this pull request Oct 17, 2024
…rtledemo.clock (gh-123457) (GH-125653) (#125656) Rewriting the day and date every tick somehow prevented them from being removed either by clicking STOP or loading another example. The solution is to rewrite them only when they change. (cherry picked from commit c124577) (cherry picked from commit 30d7e9e) Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Wulian <[email protected]>
@Wulian233Wulian233 deleted the clock branch October 17, 2024 22:22
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
….clock (python#123457) Rewriting the day and date every tick somehow prevented them from being removed either by clicking STOP or loading another example. The solution is to rewrite them only when they change.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Wulian233@terryjreedy