Skip to content

Commit 927d526

Browse files
committed
attempt at colours without colorclass
1 parent 97ee21e commit 927d526

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Interlace/lib/core/output.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
from Interlace.lib.core.__version__ import __version__
88

99

10+
class bcolors:
11+
# credit to: https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal
12+
HEADER = '\033[95m'
13+
OKBLUE = '\033[94m'
14+
OKCYAN = '\033[96m'
15+
OKGREEN = '\033[92m'
16+
WARNING = '\033[93m'
17+
FAIL = '\033[91m'
18+
ENDC = '\033[0m'
19+
BOLD = '\033[1m'
20+
UNDERLINE = '\033[4m'
21+
22+
1023
class OutputHelper(object):
1124
def __init__(self, arguments):
1225
if arguments.nocolor:
@@ -30,8 +43,8 @@ def terminal(self, level, target, command, message=""):
3043
return
3144

3245
formatting = {
33-
0: Color('{autoblue}[VERBOSE]{/autoblue}'),
34-
1: Color('{autogreen}[THREAD]{/autogreen}'),
46+
0: f'{bcolors.OKBLUE}[VERBOSE]{bcolors.ENDC}',
47+
1: f'{bcolors.OKGREEN}[THREAD]{bcolors.ENDC}',
3548
3: Color('{autobgyellow}{autored}[ERROR]{/autored}{/autobgyellow}')
3649
}
3750

0 commit comments

Comments
 (0)