You've already forked wakapi-readme-stats
fix: status code 202 error
This commit is contained in:
@@ -31,6 +31,9 @@ async def get_waka_time_stats(repositories: Dict, commit_dates: Dict) -> str:
|
||||
stats = str()
|
||||
|
||||
data = await DM.get_remote_json("waka_latest")
|
||||
if data is None:
|
||||
DBM.p("WakaTime data unavailable!")
|
||||
return stats
|
||||
if EM.SHOW_COMMIT or EM.SHOW_DAYS_OF_WEEK: # if any on flag is turned on then we need to calculate the data and print accordingly
|
||||
DBM.i("Adding user commit day time info...")
|
||||
stats += f"{await make_commit_day_time_list(data['data']['timezone'], repositories, commit_dates)}\n\n"
|
||||
@@ -89,6 +92,9 @@ async def get_short_github_info() -> str:
|
||||
stats += f"> 📦 {disk_usage} \n > \n"
|
||||
|
||||
data = await DM.get_remote_json("github_stats")
|
||||
if data is None:
|
||||
DBM.p("GitHub contributions data unavailable!")
|
||||
return stats
|
||||
DBM.i("Adding contributions info...")
|
||||
if len(data["years"]) > 0:
|
||||
contributions = FM.t("Contributions in the year") % (intcomma(data["years"][0]["total"]), data["years"][0]["year"])
|
||||
@@ -161,7 +167,10 @@ async def get_stats() -> str:
|
||||
if EM.SHOW_TOTAL_CODE_TIME:
|
||||
DBM.i("Adding total code time info...")
|
||||
data = await DM.get_remote_json("waka_all")
|
||||
stats += f"}-{quote(str(data['data']['text']))}-blue)\n\n"
|
||||
if data is None:
|
||||
DBM.p("WakaTime data unavailable!")
|
||||
else:
|
||||
stats += f"}-{quote(str(data['data']['text']))}-blue)\n\n"
|
||||
|
||||
if EM.SHOW_PROFILE_VIEWS:
|
||||
DBM.i("Adding profile views info...")
|
||||
|
||||
Reference in New Issue
Block a user