Skip to content

Commit bd034cf

Browse files
committed
attempting full removal of a dependency
1 parent 3bc171b commit bd034cf

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Diff for: Interlace/lib/core/output.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from enum import IntEnum
22
from time import localtime, strftime
33

4-
from colorclass import Color
5-
from colorclass import disable_all_colors
6-
74
from Interlace.lib.core.__version__ import __version__
85

96

@@ -22,9 +19,7 @@ class bcolors:
2219

2320
class OutputHelper(object):
2421
def __init__(self, arguments):
25-
if arguments.nocolor:
26-
disable_all_colors()
27-
22+
self._no_color = arguments.nocolor
2823
self.verbose = arguments.verbose
2924
self.silent = arguments.silent
3025
self.seperator = "====================================================="
@@ -42,11 +37,18 @@ def terminal(self, level, target, command, message=""):
4237
if level == 0 and not self.verbose:
4338
return
4439

45-
formatting = {
46-
0: f'{bcolors.OKBLUE}[VERBOSE]{bcolors.ENDC}',
47-
1: f'{bcolors.OKGREEN}[THREAD]{bcolors.ENDC}',
48-
3: f'{bcolors.FAIL}[ERROR]{bcolors.ENDC}'
49-
}
40+
if self._no_color:
41+
formatting = {
42+
0: f'{bcolors.OKBLUE}[VERBOSE]{bcolors.ENDC}',
43+
1: f'{bcolors.OKGREEN}[THREAD]{bcolors.ENDC}',
44+
3: f'{bcolors.FAIL}[ERROR]{bcolors.ENDC}'
45+
}
46+
else:
47+
formatting = {
48+
0: '[VERBOSE]',
49+
1: '[THREAD]',
50+
3: '[ERROR]'
51+
}
5052

5153
leader = formatting.get(level, '[#]')
5254

Diff for: requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
colorclass==2.2.2
21
netaddr==0.7.20
32
tqdm==4.62.3

0 commit comments

Comments
 (0)