-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor_print.py
34 lines (30 loc) · 1.15 KB
/
color_print.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
This library is used for colorful messages on the command line... It is quite simple
The ideal solution should be making a gui to the command line like in htop or powertop
Author: Kaan Goksal
9th of JULY in the year of 2017
"""
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class ColorPrint:
@staticmethod
def print_message(Type, Tag, Message):
if Type == "Error":
print(bcolors.FAIL + "[ERROR]" + " " + Tag + ": " + bcolors.ENDC + Message)
elif Type == "Ok":
print(bcolors.OKGREEN + "[OK]" + " " + Tag + ": " + bcolors.ENDC + Message)
elif Type == "OkBLUE":
print(bcolors.OKBLUE + "[OK]" + " " + Tag + ": " + bcolors.ENDC + Message)
elif Type == "Warning":
print(bcolors.WARNING + "[WARNING]" + " " + Tag + ": " + bcolors.ENDC + Message)
elif Type == "FAIL":
print(bcolors.FAIL + "[FAIL]" + " " + Tag + ": " + bcolors.ENDC + Message)
elif Type == "NORMAL":
print(Tag + ": " + Message)