Skip to content

Commit

Permalink
Clarified names.
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Jun 9, 2016
1 parent 6aa5272 commit 18b49c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gitfiti.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def load_images(img_names):
return loaded_imgs


def get_calendar(username, base_url):
def retrieve_contributions_calendar(username, base_url):
"""retrieves the GitHub commit calendar data for a username"""
base_url = base_url + 'users/' + username

Expand All @@ -222,11 +222,11 @@ def get_calendar(username, base_url):
return page.read().decode('utf-8').splitlines()


def find_max_commits(calendar):
def find_max_daily_commits(contributions_calendar):
"""finds the highest number of commits in one day"""
output = set()

for line in calendar:
for line in contributions_calendar:
for day in line.split():
if 'data-count=' in day:
commit = day.split('=')[1]
Expand Down Expand Up @@ -338,11 +338,11 @@ def main():

git_base = ghe if ghe else GITHUB_BASE_URL

cal = get_calendar(username, git_base)
contributions_calendar = retrieve_contributions_calendar(username, git_base)

max_commits = find_max_commits(cal)
max_daily_commits = find_max_daily_commits(contributions_calendar)

m = calculate_multiplier(max_commits)
m = calculate_multiplier(max_daily_commits)

repo = request_user_input(
'Enter the name of the repository to use by gitfiti: ')
Expand All @@ -361,7 +361,7 @@ def main():
'Enter the word "gitfiti" to exceed your max\n'
'(this option generates WAY more commits)\n'
'Any other input will cause the default matching behavior'
).format(max_commits))
).format(max_daily_commits))
match = request_user_input()

match = m if (match == 'gitfiti') else 1
Expand Down

0 comments on commit 18b49c1

Please sign in to comment.