Created
December 19, 2017 22:05
-
-
Save grimpy/42d38a6f3ed8b301a83c2ffec649da75 to your computer and use it in GitHub Desktop.
This file contains 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
import github | |
import argparse | |
class Generator: | |
def __init__(self, token): | |
self.git = github.Github(token) | |
def generate(self, repo, milestone): | |
repo = self.git.get_repo(repo) | |
milestone = self.get_milestone(repo, milestone) | |
for issue in repo.get_issues(milestone, 'closed'): | |
print('* [{}]({}/issues/{})'.format(issue.title, repo.html_url, issue.number)) | |
def get_milestone(self, repo, milestonename): | |
for milestone in repo.get_milestones('closed'): | |
print(milestone.title) | |
if milestone.title == milestonename: | |
return milestone | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-m', '--milestone') | |
parser.add_argument('-r', '--repo', help='Example 0-complexity/openvcloud') | |
parser.add_argument('-t', '--token', help='Github Token') | |
options = parser.parse_args() | |
gen = Generator(options.token) | |
gen.generate(options.repo, options.milestone) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment