Skip to content
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

Potentially add bold/underline options? #9

Open
TheTechRobo opened this issue Apr 15, 2021 · 5 comments · May be fixed by #10
Open

Potentially add bold/underline options? #9

TheTechRobo opened this issue Apr 15, 2021 · 5 comments · May be fixed by #10

Comments

@TheTechRobo
Copy link
Contributor

If this is a wanted feature, I might submit a PR, but I won't submit one if you don't want the feature. :)

@TheTechRobo TheTechRobo changed the title Potentially add bold= parameter? Potentially add bold option? Apr 15, 2021
@TheTechRobo TheTechRobo changed the title Potentially add bold option? Potentially add bold/underline options? Apr 15, 2021
@timmypidashev
Copy link

This would be so awesome.

@timmypidashev
Copy link

timmypidashev commented Apr 27, 2022

@TheTechRobo I forked and quickly hacked up some bold options, which follow the same usage as the interrupt param.
example:

from cprint import *

cprint.ok('ok')
cprint.ok('ok bold', bold=True)

cprint.info('info')
cprint.info('info bold', bold=True)

cprint.warn('warn')
cprint.warn('warn bold', bold=True)

cprint.err('err')
cprint.err('err bold', bold=True)

cprint.fatal('fatal')
cprint.fatal('fatal', bold=True)

image

I love this library because it uses the default system colors, so it works with any themes. I won't be making a pr of this though, as I'm pretty sure there is a better way than how I hacked it up, but it works. As far as underlining goes, I don't need it, and the way I implemented bold would make it very cluttered to have underlines, as cprint would have to account for both options being true at once as well.

@TheTechRobo
Copy link
Contributor Author

I think I might be able to clean that up tonight. :D

@TheTechRobo TheTechRobo linked a pull request May 6, 2022 that will close this issue
@TheTechRobo
Copy link
Contributor Author

There we go. It's a lot cleaner than the one you did, but takes some code from yours. It also makes the code to add underline in the future (if we ever do) pretty simple.

@timmypidashev
Copy link

Awesome!

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 a pull request may close this issue.

2 participants