rehandalal / therapist

Work out your commitment issues.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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:

https://github.com/willkg/francis/blob/c727fa5eaa77662277f95fbf000f7afc71cbbed4/francis/cmdline.py#L521

commented

Yeah I was actually looking at using couleur to do this.

commented

^