-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-128317: Highlight today in colour in calendar CLI output #128318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misc/NEWS.d/next/Library/2024-12-29-00-33-34.gh-issue-128317.WgFina.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Peter Bierma <[email protected]>
Thanks all for the reviews! |
|
||
Return a single week in a string with no newline. If *w* is provided, it | ||
specifies the width of the date columns, which are centered. Depends | ||
on the first weekday as specified in the constructor or set by the | ||
:meth:`setfirstweekday` method. | ||
|
||
.. versionchanged:: next | ||
If *highlight_day* is given, this date is highlighted in color. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this say “using terminal escape sequences”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think it's more useful to describe the end result rather than the "how".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my intention: mention that you need to print the result to a terminal to see the highlight. If you don't, you'll see some garbage bytes.
…thon#128318) Co-authored-by: Peter Bierma <[email protected]>
…thon#128318) Co-authored-by: Peter Bierma <[email protected]>
Here's the macOS
cal
command:Here's the
calendar
CLI output in 3.13:And with this PR:
Especially useful for Twixtmas when you're not sure what day it is!
The usual
PYTHON_COLORS
,FORCE_COLOR
andNO_COLOR
env vars can be used to override terminal colour detection.📚 Documentation preview 📚: https://cpython-previews--128318.org.readthedocs.build/