Skip to content

feat: Allow lob_print to have color#5

Merged
MrKevinWeiss merged 1 commit intomasterfrom
pr/addcolor
Nov 18, 2025
Merged

feat: Allow lob_print to have color#5
MrKevinWeiss merged 1 commit intomasterfrom
pr/addcolor

Conversation

@MrKevinWeiss
Copy link
Collaborator

This allows an optional kwarg color when printing. It does not need any dependencies and should fallback safely.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds optional color support to the lob_print function, allowing console output to be printed in red, green, or yellow colors. The implementation includes Windows ANSI escape sequence support for Windows 10+ and gracefully falls back to non-colored output when colors are not supported.

Key Changes:

  • Added enable_windows_ansi_support() function to enable ANSI escape sequences on Windows
  • Implemented _print_color() static method to handle colored printing with ANSI codes
  • Modified lob_print() to use the new colored printing functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/lob_hlpr/hlpr.py Added color printing support with Windows ANSI handling and new _print_color() method
tests/test_lob_hlpr.py Added test cases for red, yellow, green, and unsupported color values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This allows an optional kwarg color when printing.  It does not need any dependencies and should fallback safely.
@MrKevinWeiss MrKevinWeiss merged commit a3f6156 into master Nov 18, 2025
5 checks passed
@MrKevinWeiss MrKevinWeiss deleted the pr/addcolor branch November 18, 2025 19:12
Sign up for free to 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.

1 participant