-
Notifications
You must be signed in to change notification settings - Fork 122
#698 - Revisiting Color Support #704
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #704 +/- ##
=========================================
+ Coverage 95.23% 95.63% +0.4%
=========================================
Files 11 12 +1
Lines 3274 3345 +71
=========================================
+ Hits 3118 3199 +81
+ Misses 156 146 -10
Continue to review full report at Codecov.
|
Recommend updating test_utils.py to add new unit tests for style_message() so that new utility function has 100% code coverage. 3 or 4 unit tests should do the trick. The currently uncovered cases are:
|
Thanks for the PR! I'll take a look at it tonight. |
…perror handled both normal and exception-related messages
@xNinjaKittyx By the way, your PR is excellent, so please don't take any offense at other developers collaborating to make it even better. We might have a moderately peculiar culture here on this project, where it is extremely common for developers to collaborate and work to improve each other's PRs. |
I like this PR as-is, but I also like the direction @kmvanbrunt is moving in to address the suggestion by @kotfu to decouple the functions for outputting text from the one for styling it and think that is probably a more flexible and maintainable improvement albeit at the cost of a small amount of convenience. Some things I think we will need to address once the changes stabilize and before merging into master include: TODO
|
… types like Warning, Error, and Succes
…ing of settings in a provided TextStyle
… used to call any function to add style
@xNinjaKittyx Then I looked at the Thanks for your help and don't be discouraged from contributing in the future. I don't usually steal :) |
@kmvanbrunt It's all good. I'm glad that inspired you :D. I use this library quite a bit at work, so I thought I'd contribute when I see something I can do. I'll be on the lookout. |
Also: - Updated examples that use color to use cmd2.ansi instead of colorama - Updated tests that use color to use cmd2.ansi instead of colorama - plumbum_colorspy example shows how to override color lookup functions to use a different color library
… it is unreliable on Azure DevOps CI
@kotfu If you get a chance to look at this, your feedback would be appreciated. @xNinjaKittyx Can you please review that changes that @kmvanbrunt and I have made to your PR to make sure they all seem reasonable to you? |
I think there's a few more breaking changes that might need to be documented.
|
…d perror Also: - Updated README with more info on a couple more open-source applications using cmd2
Addresses #698
Changes:
poutput
andperror
no longer usecolor
kwarg, which has been split intofg
andbg
.fg
andbg
use human names of color likeblue
orred
.perror
is split into 2 functionsperror
andpexcept
.pexcept
will behave identical to the previousperror
, butperror
will only print to stderr with no stacktraces or Exception messages.