cprint icon indicating copy to clipboard operation
cprint copied to clipboard

Potentially add bold/underline options?

Open TheTechRobo opened this issue 3 years ago • 5 comments

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 avatar Apr 15 '21 03:04 TheTechRobo

This would be so awesome.

timmypidashev avatar Apr 27 '22 03:04 timmypidashev

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

timmypidashev avatar Apr 27 '22 03:04 timmypidashev

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

TheTechRobo avatar Apr 27 '22 13:04 TheTechRobo

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.

TheTechRobo avatar May 06 '22 00:05 TheTechRobo

Awesome!

timmypidashev avatar May 06 '22 01:05 timmypidashev