From 373e47ad602347b4b59ea3fa0f43674879d6acf2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 5 Mar 2019 14:41:21 +0100 Subject: don't use colorama for color escape codes --- src/util.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/util.py') diff --git a/src/util.py b/src/util.py index 4190f82..fbfdbc7 100644 --- a/src/util.py +++ b/src/util.py @@ -1,4 +1,3 @@ -import colorama import sys import src.globalvars @@ -6,10 +5,14 @@ import src.globalvars def allocbench_msg(color, *objects, sep=' ', end='\n', file=sys.stdout, flush=False): if src.globalvars.verbosity < 0: return - color = getattr(colorama.Fore, color) + + color = {"YELLOW": "\x1b[33m", + "GREEN": "\x1b[32m", + "RED": "\x1b[31m"}[color] + print(color, end="", file=file) print(*objects, sep=sep, end=end, file=file) - print(colorama.Fore.RESET, end="", file=file, flush=flush) + print("\x1b[0m", end="", file=file, flush=flush) def print_debug(*objects, sep=' ', end='\n', file=sys.stdout, flush=False): if src.globalvars.verbosity < 99: -- cgit v1.2.3