Skip to content

Commit 6ea4d8b

Browse files
committed
fixing issue KasperskyLab#7 regarding dependencies and coloring output
1 parent 6e1312c commit 6ea4d8b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

iShutdown_detect.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66
import re
77
import tarfile
88
from datetime import datetime
9-
from termcolor import colored
109

1110

1211
def count_occurrences(content, target_phrase):
1312
return content.count(target_phrase)
1413

1514

16-
def print_colored(text, color, blink=False):
17-
attrs = ['blink'] if blink else None
18-
print(colored(text, color, attrs=attrs))
15+
def print_colored(text, color):
16+
if color == 'red':
17+
print("\033[91m {}\033[00m" .format(text))
18+
elif color == 'yellow':
19+
print("\033[93m {}\033[00m" .format(text))
20+
elif color == 'green':
21+
print("\033[92m {}\033[00m" .format(text))
22+
else:
23+
print(text)
1924

2025

2126
def find_anomalies_before_sigterm(content, anomaly_phrase, threshold=3):

0 commit comments

Comments
 (0)