-
Notifications
You must be signed in to change notification settings - Fork 19
/
testfine.py
40 lines (27 loc) · 884 Bytes
/
testfine.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
import datetime
import os
# from heavy import special_commit
def modify():
file = open('zero.md', 'r')
flag = int(file.readline()) == 0
file.close()
file = open('zero.md', 'w+')
if flag:
file.write('1')
else:
file.write('0')
file.close()
def commit():
os.system('git commit -a -m testfine > /dev/null 2>&1')
def set_sys_time(year, month, day):
os.system('date -s %04d%02d%02d' % (year, month, day))
def trick_commit(year, month, day):
set_sys_time(year, month, day)
modify()
commit()
def daily_commit(start_date, end_date):
for i in range((end_date - start_date).days + 1):
cur_date = start_date + datetime.timedelta(days=i)
trick_commit(cur_date.year, cur_date.month, cur_date.day)
if __name__ == '__main__':
daily_commit(datetime.date(2017, 3, 31), datetime.date(2018, 1, 28))