-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcolors.py
29 lines (25 loc) · 842 Bytes
/
colors.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
from colorama import Fore, Style, init
# Colorama module's initialization.
init(autoreset=True)
class Printer:
LOG = True
def print_info(self, title, extra='', start='', end='\n'):
if self.LOG:
print(start +
Style.BRIGHT +
Fore.WHITE + "[" +
Fore.GREEN + "+" +
Fore.WHITE + "] " +
Fore.GREEN + title.ljust(15) +
Fore.YELLOW + extra,
end=end)
def print_error(self, title, extra='', start='', end='\n'):
if self.LOG:
print(start +
Style.BRIGHT +
Fore.WHITE + "[" +
Fore.RED + "-" +
Fore.WHITE + "] " +
Fore.RED + title.ljust(15) +
Fore.YELLOW + extra,
end=end)