remotes/1693045480750635534/spooky-22
Aevann1 2022-04-25 23:10:55 +02:00
parent 1b849c57c1
commit 3b3c0927f3
1 changed files with 2 additions and 2 deletions

View File

@ -205,10 +205,8 @@ def cached_chart(kind):
today_cutoff = calendar.timegm(midnight_this_morning)
if kind == "daily":
file = f"../{SITE}_daily.png"
day_cutoffs = [today_cutoff - 86400 * i for i in range(47)][1:]
else:
file = f"../{SITE}_weekly.png"
day_cutoffs = [today_cutoff - 86400 * 7 * i for i in range(47)][1:]
day_cutoffs.insert(0, calendar.timegm(now))
@ -255,6 +253,8 @@ def cached_chart(kind):
posts_chart.legend(loc='upper left', frameon=True)
comments_chart.legend(loc='upper left', frameon=True)
file = f"../{SITE}_{kind}.png"
plt.savefig(file)
plt.clf()
return file