From e2b5960e2e3c8e4033b2ca34e94bcba1feda2765 Mon Sep 17 00:00:00 2001 From: Aaron Meese Date: Mon, 10 Aug 2020 08:06:14 -0500 Subject: [PATCH] Imported function The InputGitAuthor attribute wasn't found because I forgot to import it. Still getting used to Python and importing individual modules. --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index de8c3f3..d2edae1 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ import base64 from pytz import timezone import pytz import requests -from github import Github, GithubException +from github import Github, GithubException, InputGitAuthor import datetime from string import Template from loc import LinesOfCode @@ -461,7 +461,7 @@ def get_stats(github): def decode_readme(data: str): - '''Decode the contets of old readme''' + '''Decode the contents of old readme''' decoded_bytes = base64.b64decode(data) return str(decoded_bytes, 'utf-8') @@ -487,11 +487,11 @@ if __name__ == '__main__': waka_stats = get_stats(g) rdmd = decode_readme(contents.content) new_readme = generate_new_readme(stats=waka_stats, readme=rdmd) + committer = g.InputGitAuthor('readme-bot', 'readme-bot@example.com') if new_readme != rdmd: repo.update_file(path=contents.path, message='Updated with Dev Metrics', content=new_readme, sha=contents.sha, branch='master', - committer=g.InputGitAuthor("readme-bot", - "readme-bot@example.com")) + committer=committer) print("Readme updated") except Exception as e: traceback.print_exc()