From fa7ccc78c2d95d6af3a51d4e6a8e69ba30e95e63 Mon Sep 17 00:00:00 2001 From: nex <53234499+EEKIM10@users.noreply.github.com> Date: Tue, 1 Nov 2022 09:35:50 +0000 Subject: [PATCH] Debug timetable updater again --- cogs/timetable.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cogs/timetable.py b/cogs/timetable.py index bb3b858..64792da 100644 --- a/cogs/timetable.py +++ b/cogs/timetable.py @@ -15,6 +15,9 @@ def schedule_times(): for h in range(24): for m in range(0, 60, 15): times.append(time(h, m, 0)) + print("[TimeTable Updater Task] Update times:") + for _time in times: + print("[TimeTable Updater Task] {0.hour}:{0.minute}".format(_time)) return times @@ -25,6 +28,9 @@ class TimeTableCog(commands.Cog): self.timetable = json.load(file) self.update_status.start() + def cog_unload(self): + self.update_status.stop() + def are_on_break(self, date: datetime = None) -> Optional[Dict[str, Union[str, datetime]]]: """Checks if the date is one as a term break""" date = date or datetime.now() @@ -36,9 +42,6 @@ class TimeTableCog(commands.Cog): if date.timestamp() <= end_date.timestamp() and date.timestamp() >= start_date.timestamp(): return {"name": name, "start": start_date, "end": end_date} - def cog_unload(self): - self.update_status.stop() - def current_lesson(self, date: datetime = None) -> Optional[dict]: date = date or datetime.now() lessons = self.timetable.get(date.strftime("%A").lower(), [])