aboutsummaryrefslogtreecommitdiff
path: root/src/util.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-03-05 14:41:21 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-03-05 14:41:21 +0100
commit373e47ad602347b4b59ea3fa0f43674879d6acf2 (patch)
treed7bb86dc9b5a38ac2141a1ebfecad5f26425ab79 /src/util.py
parent043598070d4cb62facfedf59a87adb9e2a3cb7da (diff)
downloadallocbench-373e47ad602347b4b59ea3fa0f43674879d6acf2.tar.gz
allocbench-373e47ad602347b4b59ea3fa0f43674879d6acf2.zip
don't use colorama for color escape codes
Diffstat (limited to 'src/util.py')
-rw-r--r--src/util.py9
1 files changed, 6 insertions, 3 deletions
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: