-
Notifications
You must be signed in to change notification settings - Fork 38
/
mygitcheck.py.sample
53 lines (46 loc) · 1.65 KB
/
mygitcheck.py.sample
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
from colored import fg, bg, attr
from colored import colored as cobj
# In developpement mode, for use
# python ~/mygitcheck.py
# python ~/mygitcheck.py | grep magenta
defaultcolor = attr('reset') + fg('white')
colortheme = {
'default': defaultcolor,
'prjchanged': attr('reset') + attr('bold') + fg('deep_pink_1a'),
'prjremote': attr('reverse') + fg('light_cyan'),
'prjname': attr('reset') + fg('chartreuse_1'),
'reponame': attr('reset') + fg('light_goldenrod_2b'),
'branchname': defaultcolor,
'fileupdated': attr('reset') + fg('light_goldenrod_2b'),
'remoteto': attr('reset') + fg('deep_sky_blue_3b'),
'committo': attr('reset') + fg('violet'),
'commitinfo': attr('reset') + fg('deep_sky_blue_3b'),
'commitstate': attr('reset') + fg('deep_pink_1a'),
'bell': "\a",
'reset': "\033[2J\033[H"
}
def searchKeyByValue(search):
"""Search keyname by value"""
c = cobj(0)
for key, value in c.paint.iteritems():
if value == str(search):
return key
def searchMaxColorName():
"""Search Max length colorname"""
c = cobj(0)
maxi = 0
for key, value in c.paint.iteritems():
lencolor = len(str(key))
maxi = max(lencolor, maxi)
print "Lencolor: %s" % maxi
if __name__ == "__main__":
#searchMaxColorName()
for idx in range(0, 255):
print "%s%19s %s%s%s%s" % (
attr('reset') + fg(idx),
searchKeyByValue(idx),
'Normal',
attr('reset') + fg(idx) + attr('bold') + 'Bold',
attr('reset') + fg(idx) + attr('underlined') + 'Underline',
attr('reset') + fg(idx) + attr('reverse') + 'Reverse',
)