1 Star 0 Fork 0

Ekber/checkbox-sample

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
greenhat.py 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
litao0621 提交于 2016-07-01 17:58 . add greenhat file
# Copyright (c) 2015 Angus H. (4148)
# Distributed under the GNU General Public License v3.0 (GPLv3).
from datetime import date, timedelta
from random import randint
from time import sleep
import sys
import subprocess
import os
# returns a date string for the date that is N days before STARTDATE
def get_date_string(n, startdate):
d = startdate - timedelta(days=n)
rtn = d.strftime("%a %b %d %X %Y %z -0400")
return rtn
# main app
def main(argv):
if len(argv) < 1 or len(argv) > 2:
print "Error: Bad input."
sys.exit(1)
n = int(argv[0])
if len(argv) == 1:
startdate = date.today()
if len(argv) == 2:
startdate = date(int(argv[1][0:4]), int(argv[1][5:7]), int(argv[1][8:10]))
i = 0
while i <= n:
curdate = get_date_string(i, startdate)
num_commits = randint(1, 10)
for commit in range(0, num_commits):
subprocess.call("echo '" + curdate + str(randint(0, 1000000)) +"' > realwork.txt; git add realwork.txt; GIT_AUTHOR_DATE='" + curdate + "' GIT_COMMITTER_DATE='" + curdate + "' git commit -m 'update'; git push;", shell=True)
sleep(.5)
i += 1
subprocess.call("git rm realwork.txt; git commit -m 'delete'; git push;", shell=True)
if __name__ == "__main__":
main(sys.argv[1:])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ekber/checkbox-sample.git
git@gitee.com:ekber/checkbox-sample.git
ekber
checkbox-sample
checkbox-sample
master

搜索帮助