diff --git a/gitfiti.py b/gitfiti.py index ac1afcdb5..e83fc5486 100755 --- a/gitfiti.py +++ b/gitfiti.py @@ -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 @@ -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] @@ -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: ') @@ -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