I just recently discovered we're using colorama when reviewing https://github.com/iterative/dvc/pull/2765/files but haven't really noticed it much in most DVC output.
Current use I can see now:
colorama.Fore.BLUE is used for some URLs. I like this, should check it's ALL URLs.RED and GREEN are used in the updater. This seems OK.BLUE, RED, and YELLOW in the logger.CYAN (called blue) is used for the man.dvc.org URLs here and here. Not sure we need this per the first bullet (BLUE).MAGENTA for 2 "HINT" messages here and here. Should check it's used in all such hints, and that other "SOMETHING:" messages always have heir own colors.colorize function in dvc/dvc/utils/__init__.py:BLUE for sample commands in the output (those surrounded with back ticks for example. Should we apply this everywhere? (Also "dynamic" commands, printed inside single quotes'`.)Good catch @jorgeorpinel !
There's this colorize function in dvc/dvc/utils/init.py
It is used in boxify https://github.com/iterative/dvc/blob/master/dvc/utils/__init__.py#L389 .
Thanks. Should probably use it more or remove it?
@jorgeorpinel Hm, why remove it? But yeah, could definitely use it more :)
Idk. It only knows 4 colors rn, and the resulting syntax is not that easy to read, at least in boxify:
"{border}{space}{border}\n".format(
border=colorize(chars["vertical"], color=border_color),
space=chars["empty"] * box_size_horizontal,
vs. something like
"{blue}text{nc}\n".format(blue=colorama.Fore.BLUE...