GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-128317: Highlight today in colour in calendar CLI output by hugovk · Pull Request #128318 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented Dec 28, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Here's the macOS cal command:

image image

Here's the calendar CLI output in 3.13:

image image

And with this PR:

image image

Especially useful for Twixtmas when you're not sure what day it is!

The usual PYTHON_COLORS, FORCE_COLOR and NO_COLOR env vars can be used to override terminal colour detection.

  • Issue: Highlight today in colour in calendar's CLI output #128317

📚 Documentation preview 📚: https://cpython-previews--128318.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

network-shark reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@hugovk
Highlight today in colour in calendar CLI output
e690607
@bedevere-app bedevere-app Bot mentioned this pull request Dec 28, 2024
Highlight today in colour in calendar's CLI output #128317
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Dec 28, 2024
@hugovk hugovk added the type-feature A feature request or enhancement label Dec 28, 2024
ZeroIntensity
ZeroIntensity reviewed Dec 29, 2024
View reviewed changes

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

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.

Nice, here's what it looks like on KDE :)

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Misc/NEWS.d/next/Library/2024-12-29-00-33-34.gh-issue-128317.WgFina.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk @ZeroIntensity
Improve docs
3608954
Co-authored-by: Peter Bierma <[email protected]>
hugovk
hugovk commented Dec 29, 2024
View reviewed changes
Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Document the new highlight_day argument
ad2921c
erlend-aasland
erlend-aasland reviewed Dec 29, 2024
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

srinivasreddy
srinivasreddy reviewed Dec 30, 2024
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Merge branch 'main' into 3.14-calendar-colour
e31133f
erlend-aasland
erlend-aasland approved these changes Jan 3, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jan 3, 2025
hugovk added 2 commits January 3, 2025 14:30
@hugovk
Merge remote-tracking branch 'upstream/main' into 3.14-calendar-colour
2749ff8
@hugovk
Re-add whitespace
a565d97
@hugovk
hugovk merged commit f21af18 into python:main Jan 3, 2025
@hugovk
hugovk deleted the 3.14-calendar-colour branch January 3, 2025 12:56
@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 3, 2025
@hugovk

hugovk commented Jan 3, 2025

Copy link
Copy Markdown
Member Author

Thanks all for the reviews!

erlend-aasland and srinivasreddy reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou
encukou reviewed Jan 3, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst
:meth:`setfirstweekday` method.

.. versionchanged:: next
If *highlight_day* is given, this date is highlighted in color.

@encukou encukou Jan 3, 2025

Copy link
Copy Markdown
Member

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”?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk Jan 5, 2025

Copy link
Copy Markdown
Member Author

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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@encukou encukou Jan 6, 2025

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
WolframAlph pushed a commit to WolframAlph/cpython that referenced this pull request Jan 4, 2025
@hugovk @ZeroIntensity @WolframAlph
pythongh-128317: Highlight today in colour in calendar CLI output (py…
49140ab
…thon#128318)

Co-authored-by: Peter Bierma <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@hugovk @ZeroIntensity @srinivasreddy
pythongh-128317: Highlight today in colour in calendar CLI output (py…
bf9975c
…thon#128318)

Co-authored-by: Peter Bierma <[email protected]>
@erlend-aasland erlend-aasland mentioned this pull request Jan 20, 2025
Empty values of FORCE_COLOR and NO_COLOR are not ignored #129061
Closed
@hugovk hugovk mentioned this pull request Feb 3, 2025
gh-128317: Move CLI calendar highlighting to private class #129625
Merged
This was referenced Apr 10, 2026
Add more colour to calendar CLI output #148352
Closed
gh-148352: Add more colour to calendar CLI output #148354
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou left review comments
@ZeroIntensity ZeroIntensity ZeroIntensity left review comments
@erlend-aasland erlend-aasland erlend-aasland approved these changes
+1 more reviewer
@srinivasreddy srinivasreddy srinivasreddy left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@hugovk @srinivasreddy @encukou @erlend-aasland @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.