-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.py
29 lines (22 loc) · 858 Bytes
/
util.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 progress.bar import Bar
class OutColors:
PURPLE = '\033[95m' # purple
OKBLUE = '\033[34m'
OKGREEN = '\033[32m'
WARNING = '\033[33m' # orange
FAIL = '\033[91m' # light red
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
OUTPUT_SEPARATOR = OutColors.PURPLE + '*****************************************************' + OutColors.ENDC
OUTPUT_ERROR = OutColors.FAIL + '***************ERROR***************' + OutColors.ENDC
def print_header(msg):
print(OutColors.BOLD + OutColors.UNDERLINE + msg + OutColors.ENDC)
def print_success(succMsg):
print(OutColors.OKGREEN + succMsg + OutColors.ENDC)
def print_warning(warnMsg):
print(OutColors.WARNING + warnMsg + OutColors.ENDC)
def print_error(errMsg):
print(OutColors.FAIL + errMsg + OutColors.ENDC)
class PercentBar(Bar):
suffix='%(percent)d%%'