From a198a831531aba367bc2c292dc208daa7ae16fd4 Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Sun, 8 Aug 2021 18:24:53 +0200 Subject: [PATCH] Clean up imports --- cogs/school.py | 6 ++---- functions/les.py | 31 ------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 functions/les.py diff --git a/cogs/school.py b/cogs/school.py index dca3555..3768a74 100644 --- a/cogs/school.py +++ b/cogs/school.py @@ -1,12 +1,10 @@ -from data import constants, schedule +from data import schedule from decorators import help import discord from discord.ext import commands -from enums.courses import years from enums.help_categories import Category -from functions import checks, config, eten, les +from functions import config, eten, les from functions.timeFormatters import intToWeekday -import json class School(commands.Cog): diff --git a/functions/les.py b/functions/les.py deleted file mode 100644 index 3c96154..0000000 --- a/functions/les.py +++ /dev/null @@ -1,31 +0,0 @@ -from datetime import datetime, timedelta -from functions.timeFormatters import dateTimeNow, weekdayToInt, forward_to_weekday, skip_weekends -from typing import Optional - - -def find_target_date(arg: Optional[str]) -> datetime: - """ - Find the requested date out of the user's arguments - """ - # Start at current date - day: datetime = dateTimeNow() - - # If no offset was provided, check the time - # otherwise the argument overrides it - if arg is None: - # When the command is used after 6 pm, show schedule - # for the next day instead - if day.hour > 18: - day += timedelta(days=1) - elif 0 <= (weekday := weekdayToInt(arg)) <= 4: # Weekday provided - day = forward_to_weekday(day, weekday) - elif arg.lower() == "morgen": # Tomorrow's schedule - day += timedelta(days=1) - elif arg.lower() == "overmorgen": # Day after tomorrow's schedule - day += timedelta(days=2) - - # TODO show a different embed when "(over)morgen" is requested & it lands on a weekend - # Don't land on a weekend - day = skip_weekends(day) - - return day