-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprettycli.py
60 lines (51 loc) · 1.65 KB
/
prettycli.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
49
50
51
52
53
54
55
56
57
58
59
60
# -*- coding: utf-8 -*-
colors = {
'red': '\033[31m',
'redBold': '\033[1;31m',
'green': '\033[32m',
'greenBold': '\033[1;32m',
'yellow': '\033[33m',
'yellowBold': '\033[1;33m',
'blue': '\033[34m',
'blueBold': '\033[1;34m',
'blueUnderline': '\033[4;34m',
'megenta': '\033[35m',
'megentaBold': '\033[1;35m',
'cyan': '\033[1;36m',
'cyanBold': '\033[1;36m',
'greyLight': '\033[2;37m',
'clear': '\033[0m',
'hidden': ''
}
def info(text, label='INFO'):
''' green
'''
return '\n{c[greenBold]} {label} 💁 {c[green]} {text} {c[clear]}'.format(c=colors, label=label, text=text)
def warn(text, label='WARN'):
''' yellow
'''
return '\n{c[yellowBold]} {label} ⚠️ {c[yellow]} {text} {c[clear]}'.format(c=colors, label=label, text=text)
def error(text, label='ERROR'):
''' red
'''
return '\n{c[redBold]} {label} 🤦 {c[red]} {text} {c[clear]}'.format(c=colors, label=label, text=text)
def wait(text, label='WAIT'):
''' blue
'''
return '\n{c[blueBold]} {label} 🙄 {c[blue]} {text} {c[clear]}'.format(c=colors, label=label, text=text)
def critical(text, label='CRITICAL'):
''' critical
'''
return '\n{c[megentaBold]} {label} 🚨 {c[megenta]} {text} {c[clear]}'.format(c=colors, label=label, text=text)
def command(text):
''' cyan
'''
return '\n⚡ {c[cyanBold]}{text}{c[clear]}'.format(c=colors, text=text)
def link(text):
''' blue
'''
return '\n🔗 {c[blueUnderline]}{text}{c[clear]}'.format(c=colors, text=text)
def ignore(text):
''' grey
'''
return '\n😴 {c[greyLight]}{text}{c[clear]}'.format(c=colors, text=text)