diff --git a/src/constants.py b/src/constants.py index e1d9756..e80c788 100644 --- a/src/constants.py +++ b/src/constants.py @@ -17,6 +17,7 @@ SCHWARTZ_EMAIL = "ems@ufl.edu" + def semester_given_date( date: datetime.datetime, *, @@ -29,6 +30,7 @@ def semester_given_date( return semester return None + class Team(enum.Enum): SOFTWARE = auto() ELECTRICAL = auto() diff --git a/src/reports.py b/src/reports.py index e5f1d16..bee6e7d 100644 --- a/src/reports.py +++ b/src/reports.py @@ -11,10 +11,9 @@ import discord import gspread -import gspread_asyncio from discord.ext import commands -from .constants import SCHWARTZ_EMAIL, Team, semester_given_date +from .constants import BREAKS, SCHWARTZ_EMAIL, Team, semester_given_date from .email import Email from .tasks import run_on_weekday from .utils import is_active, ordinal @@ -64,10 +63,7 @@ def _end_date(cls) -> datetime.date: @staticmethod def _is_break(date: datetime.date) -> bool: - for start, end in BREAKS: - if start <= date <= end: - return True - return False + return any(start <= date <= end for start, end in BREAKS) def _date_to_index(self, date: datetime.date) -> int: current_date = self._start_date() @@ -144,6 +140,7 @@ def __post_init__(self): f"Cannot create report column with index {self.report_column}.", ) + class FiringEmail(Email): """ Email to Dr. Schwartz + team lead about needing to fire someone