diff --git a/compiler/color.py b/compiler/color.py new file mode 100644 index 0000000..8f904fd --- /dev/null +++ b/compiler/color.py @@ -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")