ADDED: ERROR TRACEBACK

This commit is contained in:
Anmol
2020-08-02 11:52:23 +05:30
parent ed4f004458
commit 3f334bdf10

View File

@@ -12,6 +12,7 @@ import datetime
from string import Template from string import Template
from loc import LinesOfCode from loc import LinesOfCode
import time import time
import traceback
START_COMMENT = '<!--START_SECTION:waka-->' START_COMMENT = '<!--START_SECTION:waka-->'
END_COMMENT = '<!--END_SECTION:waka-->' END_COMMENT = '<!--END_SECTION:waka-->'
@@ -412,15 +413,16 @@ if __name__ == '__main__':
user_data = run_query(userInfoQuery) # Execute the query user_data = run_query(userInfoQuery) # Execute the query
username = user_data["data"]["viewer"]["login"] username = user_data["data"]["viewer"]["login"]
id = user_data["data"]["viewer"]["id"] id = user_data["data"]["viewer"]["id"]
print(username)
repo = g.get_repo(f"{username}/{username}") repo = g.get_repo(f"{username}/{username}")
contents = repo.get_readme() contents = repo.get_readme()
waka_stats = get_stats() waka_stats = get_stats()
rdmd = decode_readme(contents.content) rdmd = decode_readme(contents.content)
new_readme = generate_new_readme(stats=waka_stats, readme=rdmd) new_readme = generate_new_readme(stats=waka_stats, readme=rdmd)
# print(new_readme)
if new_readme != rdmd: if new_readme != rdmd:
repo.update_file(path=contents.path, message='Updated with Dev Metrics', repo.update_file(path=contents.path, message='Updated with Dev Metrics',
content=new_readme, sha=contents.sha, branch='master') content=new_readme, sha=contents.sha, branch='master')
print("Readme updated") print("Readme updated")
except Exception as e: except Exception as e:
traceback.print_exc()
print("Exception Occurred " + str(e)) print("Exception Occurred " + str(e))