Skip to content

Commit

Permalink
github_issues: Simple refactor
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
ccordoba12 committed Jan 27, 2016
1 parent 4275f7a commit 775f4fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions github_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@
help="What page to select when asking Github for issues "
"and pull requests of a given milestone. Default is "
"1, and it contains 100 results")
results = parser.parse_args()
options = parser.parse_args()

# Creating the main class to interact with Github
gh = github.GitHub()
repo = gh.repos('spyder-ide')('spyder')

if not results.milestone:
if not options.milestone:
print('Please pass a milestone to this script. See its help')
sys.exit(1)

# Get milestone number, given its name
milestones = repo.milestones.get(state='all')
milestone_number = -1
for ms in milestones:
if ms['title'] == results.milestone:
if ms['title'] == options.milestone:
milestone_number = ms['number']

if milestone_number == -1:
Expand All @@ -58,7 +58,7 @@

# This returns issues and pull requests
issues = repo.issues.get(milestone=milestone_number, state='closed',
per_page='100', page=results.page)
per_page='100', page=options.page)

# Printing issues
print('\n**Issues**\n')
Expand All @@ -68,7 +68,7 @@
if not pr:
number_of_issues += 1
number = i['number']
if results.format == 'changelog':
if options.format == 'changelog':
issue_link = "* [Issue %d](../../issues/%d)" % (number, number)
else:
issue_link = "* Issue #%d" % number
Expand All @@ -83,7 +83,7 @@
if pr:
number_of_prs += 1
number = i['number']
if results.format == 'changelog':
if options.format == 'changelog':
pr_link = "* [PR %d](../../pull/%d)" % (number, number)
else:
pr_link = "* PR #%d" % number
Expand Down

0 comments on commit 775f4fc

Please sign in to comment.