use lib for ansi color support
willkg opened this issue · comments
This file is doing ansi color code stuff:
https://github.com/rehandalal/therapist/blob/master/therapist/printer.py
However, I suggest you not roll your own and instead do it with click or blessings or one of the other libs that takes into account terminal types and tty and a bunch of other things.
- click: http://click.pocoo.org/5/utils/#ansi-colors
- blessings: https://pypi.python.org/pypi/blessings
- blessed (fork of blessings): http://blessed.readthedocs.io/en/latest/overview.html
When I wrote francis, I used the click support. It's limited in its color choices, but was good enough to not require another library:
^