-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspray.py
128 lines (103 loc) · 3.28 KB
/
spray.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import sys
import datetime
from datetime import timedelta
import os
# Edit this if you want to change the message. The default says "BiN MiCRO$oFT!". :-P
row0 = [1,1,1,0,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1];
row1 = [1,0,0,1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,0,0,1,0,0,1];
row2 = [1,0,0,1,0,1,0,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,0,1,0,0,1];
row3 = [1,1,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,0,1];
row4 = [1,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,1,0,0,1];
row5 = [1,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,0,0,1,0,0,0];
row6 = [1,1,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,0,1,0,0,1];
x = range(52)
row0str = ""
row1str = ""
row2str = ""
row3str = ""
row4str = ""
row5str = ""
row6str = ""
for n in x:
if row0[n] == 1:
row0str = row0str + "X"
else:
row0str = row0str + " "
if row1[n] == 1:
row1str = row1str + "X"
else:
row1str = row1str + " "
if row2[n] == 1:
row2str = row2str + "X"
else:
row2str = row2str + " "
if row3[n] == 1:
row3str = row3str + "X"
else:
row3str = row3str + " "
if row4[n] == 1:
row4str = row4str + "X"
else:
row4str = row4str + " "
if row5[n] == 1:
row5str = row5str + "X"
else:
row5str = row5str + " "
if row6[n] == 1:
row6str = row6str + "X"
else:
row6str = row6str + " "
white=u'\u2588'
black=' '
row0str = row0str.replace('X', white).replace(' ', black)
row1str = row1str.replace('X', white).replace(' ', black)
row2str = row2str.replace('X', white).replace(' ', black)
row3str = row3str.replace('X', white).replace(' ', black)
row4str = row4str.replace('X', white).replace(' ', black)
row5str = row5str.replace('X', white).replace(' ', black)
row6str = row6str.replace('X', white).replace(' ', black)
print(row0str)
print(row1str)
print(row2str)
print(row3str)
print(row4str)
print(row5str)
print(row6str)
def last_saturday():
today = datetime.date.today()
last_seven_dates_from_yesterday = {}
mod_count = -1
for i in range(7):
tdelta = datetime.timedelta(mod_count)
mod_count -= 1
date = today + tdelta
last_seven_dates_from_yesterday[date.weekday()] = date
answer=last_seven_dates_from_yesterday[5]
return answer
def this_row(row_num):
switch={
0: row0,
1: row1,
2: row2,
3: row3,
4: row4,
5: row5,
6: row6
}
return switch.get(row_num,'Choose one of the following operator:+,-,*,/,%')
rowpos = 6
colpos = 51
days_per_year = range(364)
for n in days_per_year:
#print "> rowpos = " + str(rowpos) + ", colpos = " + str(colpos)
#print this_row(rowpos)[colpos]
dateting = (last_saturday() - timedelta(days=n)).ctime()
#print dateting
create_commit_command = 'GIT_COMMITTER_DATE="' + dateting + ' -0900" git commit --author="Grafiti Actual <[email protected]>" --allow-empty --date="' + dateting + ' -0900" -m \':P\''
if this_row(rowpos)[colpos] == 1:
print create_commit_command
os.system(create_commit_command)
rowpos -= 1
if rowpos == -1:
rowpos = 6
colpos -= 1