jnrbase
Note
This module requires click, which pip users can install with the jnrbase[colour] requirement.
jnrbase[colour]
jnrbase.colourise.
COLOUR
Global flag to disable all colourisation
_colourise
Colour text, if possible.
text (str) – Text to colourise
str
colour (str) – Colour to display text in
Colourised text, if possible
fail
Format a failure message.
__text (str) – Text to format
Bright red text, if possible
info
Format an informational message.
Bright blue text, if possible
success
Format a success message.
Bright green text, if possible
warn
Format a warning message.
Bright yellow text, if possible
pfail
Pretty print a failure message to stderr.
stderr
__text (str) – Text to print
None
pinfo
Pretty print an informational message to stdout.
stdout
psuccess
Pretty print a success message to stdout.
pwarn
Pretty print a warning message to stderr.
>>> fail('Error!') 'Error!' >>> info('Cats are not dogs') 'Cats are not dogs' >>> success('Excellent') 'Excellent' >>> warn('Ick') 'Ick'