gh-148352: Add more colour to calendar CLI output#148354
Merged
hugovk merged 10 commits intopython:mainfrom May 4, 2026
Merged
gh-148352: Add more colour to calendar CLI output#148354hugovk merged 10 commits intopython:mainfrom
calendar CLI output#148354hugovk merged 10 commits intopython:mainfrom
Conversation
sharktide
reviewed
Apr 10, 2026
Co-authored-by: Rihaan Meher <[email protected]>
sharktide
reviewed
Apr 10, 2026
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Rihaan Meher <[email protected]>
| @@ -1122,4 +1123,4 @@ | |||
| self.assertCmdFails(*args) | |||
|
|
|||
| @support.force_not_colorized | |||
| self.assertCmdFails(*args) | ||
|
|
||
| @support.force_not_colorized | ||
| def test_help(self): |
Member
There was a problem hiding this comment.
Can we also have a case checking for color?
Documentation build overview
52 files changed ·
|
| today = datetime.date(2026, 5, 4) | ||
| cal = calendar._CLIDemoCalendar(highlight_day=today) | ||
| output = cal.formatmonth(2026, 5) | ||
| self.assertIn("\x1b[30m\x1b[43mMay 2026\x1b[0m\n\x1b[36m", output) |
Member
There was a problem hiding this comment.
Hmm, do we support running tests with different themes? If a user has a custom theme this test will fail.
Member
Author
There was a problem hiding this comment.
We don't support running tests with different themes.
Other tests could also break if the user changed the theme:
❯ rg "x1b" Lib/test/test_*.py -l | wc -l
13Right now the theme API is internal/private. If we make it public in a later release, we'll need to consider tests are with the default theme or a specific theme.
Member
Author
|
Thanks @sharktide and @StanFromIreland for the reviews! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In Python 3.14, we added an amazing colour highlight for today: #128318.
Let's add a touch more colour.
calendarCLI output #148352📚 Documentation preview 📚: https://cpython-previews--148354.org.readthedocs.build/