color: init color util class

This commit is contained in:
Antoine Viallon 2024-05-14 23:05:23 +02:00
parent 5623bebe34
commit df65952cfc
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

20
compiler/color.py Normal file
View file

@ -0,0 +1,20 @@
import logging
logger = logging.Logger(__name__)
class Color(str):
pass
def colored(text, *args, **kwargs):
return text
try:
from termcolor import termcolor
Color = termcolor.Color
colored = termcolor.colored
except ModuleNotFoundError:
logger.warning("termcolor is not installed, colored output won't be available")