-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.py
48 lines (39 loc) · 996 Bytes
/
message.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import enum
from flask import flash
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class MsgType(enum.Enum):
HEADER = 1
OKBLUE = 2
OKCYAN = 3
OKGREEN = 4
WARNING = 5
FAIL = 6
ENDC = 7
BOLD = 8
UNDERLINE = 9
def prettyprint(msg_text, msg_type):
if msg_type == MsgType.HEADER:
flash(f"{msg_text}")
elif msg_type == MsgType.OKBLUE:
flash(f"{msg_text}")
elif msg_type == MsgType.OKCYAN:
flash(f"{msg_text}")
elif msg_type == MsgType.OKGREEN:
flash(f"{msg_text}")
elif msg_type == MsgType.WARNING:
flash(f"{msg_text}")
elif msg_type == MsgType.FAIL:
flash(f"{msg_text}")
elif msg_type == MsgType.BOLD:
flash(f"{msg_text}")
elif msg_type == MsgType.UNDERLINE:
flash(f"{msg_text}")