Last active
November 29, 2019 08:23
-
-
Save muxueqz/4a8297acc233b12e91420f56d715f28e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#-*- coding: utf-8 -*- | |
import datetime | |
from github import Github | |
token = '' | |
repo_name = '' | |
g = Github(token) | |
repo = g.get_repo(repo_name) | |
monday = datetime.datetime.today() + datetime.timedelta( | |
days=-datetime.date.today().weekday() - 1 | |
) | |
open_issues = repo.get_issues( | |
state='all', | |
since=monday, | |
assignee='muxueqz' | |
) | |
task_done = [] | |
task_plan = [] | |
for issue in open_issues: | |
tasks = task_plan | |
if issue.state == 'closed': | |
tasks = task_done | |
d = '%s [#%d](%s/%s/issues/%d)' % ( | |
issue.title, | |
issue.number, | |
'https://github.com', | |
repo_name, | |
issue.number, | |
) | |
tasks.append(d) | |
weekly = [] | |
weekly.append('### 你的大名') | |
weekly.append('* 本周完成') | |
for i in task_done: | |
weekly.append(' * ' + i) | |
weekly.append('* 下周计划') | |
for i in task_plan: | |
weekly.append(' * ' + i) | |
with open('weekly.md', 'w') as _fd: | |
_fd.write('\n'.join(weekly)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment