Mensa-Fix

This commit is contained in:
2024-01-22 18:10:41 +01:00
parent 3b8cf7e53d
commit 4260ca0e92
2 changed files with 7 additions and 5 deletions

View File

@ -144,7 +144,6 @@ def getPruefung(url):
col = [e.text.strip() for e in cols] col = [e.text.strip() for e in cols]
if len(col) == 6 and len(col[3]) <= 13: if len(col) == 6 and len(col[3]) <= 13:
if len(col[3]) != 0: if len(col[3]) != 0:
print (col)
ret += [col[0] + ": " + col[3][:3]] ret += [col[0] + ": " + col[3][:3]]
if ret[-1][0] == ':': if ret[-1][0] == ':':
ret[-1] = "Gesamt" + ret[-1] ret[-1] = "Gesamt" + ret[-1]

View File

@ -40,7 +40,6 @@ def getMealsFromAPI(day: str, dbentry: bool = False):
response = response.content response = response.content
jres = json.loads(response.decode("utf-8")) jres = json.loads(response.decode("utf-8"))
essen = [] essen = []
try: try:
num = len(jres["data"][0]["lines"]) num = len(jres["data"][0]["lines"])
for i in range(num): for i in range(num):
@ -99,11 +98,15 @@ def formatDay(day: datetime):
:param day: :param day:
:return str: :return str:
""" """
if day.month < 10:
mon = "0" + str(day.month)
else:
mon = str(day.month)
if day.day < 10: if day.day < 10:
tag = "0" + str(day.day) tag = "0" + str(day.day)
else: else:
tag = str(day.day) tag = str(day.day)
day = str(day.year) + "-" + str(day.month) + "-" + tag day = str(day.year) + "-" + mon + "-" + tag
return day return day