diff --git a/pyproject.toml b/pyproject.toml index 892d412..39b64ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ dependencies = [ "httpx==0.28.1", "icalendar==7.0.3", "jinja2==3.1.6", - "logging==0.4.9.6", "python-multipart==0.0.22", "pyyaml==6.0.3", "recurring-ical-events==3.8.1", diff --git a/src/config.py b/src/config.py index ed4f90e..a68b2eb 100644 --- a/src/config.py +++ b/src/config.py @@ -78,6 +78,9 @@ def _get_env_variable(name: str, default: str | None = None) -> str | None: SLACK_TECHNICAL_SEMINAR_KEYWORD: str = _get_env_variable( "SLACK_TECHNICAL_SEMINAR_KEYWORD", "technical" ) +SLACK_ADHOC_KEYWORD: str = _get_env_variable( + "SLACK_ADHOC_KEYWORD", "adhoc" +) SLACK_ALLOW_ANNOUNCEMENTS: bool = ( _get_env_variable("SLACK_ALLOW_ANNOUNCEMENTS", "false") == "true" diff --git a/src/core/announcement_queue.py b/src/core/announcement_queue.py index decb026..eebcbb5 100644 --- a/src/core/announcement_queue.py +++ b/src/core/announcement_queue.py @@ -20,6 +20,7 @@ SLACK_TECHNICAL_SEMINAR_KEYWORD, SLACK_NONTECHNICAL_SEMINAR_KEYWORD, SLACK_MEETINGS_KEYWORD, + SLACK_ADHOC_KEYWORD, LOGGING_LEVEL, ) @@ -53,7 +54,6 @@ async def create_announcement_worker( key: str = f"{event_uid}:{event_recurrence_id}" # we should use redis instead - logger.info(key) current_time: datetime = datetime.now(ZoneInfo(CALENDAR_TIMEZONE)) if current_time < (event_time - timedelta(minutes=MINUTES_BEFORE_EVENT_PING)): wait_time = ( @@ -160,6 +160,9 @@ def check_for_announcement(event: dict[str, Any], time: datetime) -> str | None: case x if SLACK_MEETINGS_KEYWORD.lower() in x: message = f" The {title} directorship will be happening {f'in the {loc} ' if loc else ''}in {MINUTES_BEFORE_EVENT_PING} minutes!" + case x if SLACK_ADHOC_KEYWORD.lower() in x: + message = f" The {title} adhoc will be happening {f'in the {loc} ' if loc else ''}in {MINUTES_BEFORE_EVENT_PING} minutes!" + case x if "gick" in x: message = f" {f'gick go to the {loc}' if loc else 'hi gick'}!" diff --git a/uv.lock b/uv.lock index 9f9843f..0bb408b 100644 --- a/uv.lock +++ b/uv.lock @@ -684,7 +684,6 @@ dependencies = [ { name = "httpx" }, { name = "icalendar" }, { name = "jinja2" }, - { name = "logging" }, { name = "python-multipart" }, { name = "pyyaml" }, { name = "recurring-ical-events" }, @@ -722,7 +721,6 @@ requires-dist = [ { name = "httpx", specifier = "==0.28.1" }, { name = "icalendar", specifier = "==7.0.3" }, { name = "jinja2", specifier = "==3.1.6" }, - { name = "logging", specifier = "==0.4.9.6" }, { name = "python-multipart", specifier = "==0.0.22" }, { name = "pyyaml", specifier = "==6.0.3" }, { name = "recurring-ical-events", specifier = "==3.8.1" }, @@ -750,12 +748,6 @@ tests = [ { name = "pytest", specifier = "==9.0.2" }, ] -[[package]] -name = "logging" -version = "0.4.9.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/93/4b/979db9e44be09f71e85c9c8cfc42f258adfb7d93ce01deed2788b2948919/logging-0.4.9.6.tar.gz", hash = "sha256:26f6b50773f085042d301085bd1bf5d9f3735704db9f37c1ce6d8b85c38f2417", size = 96029, upload-time = "2013-06-04T23:43:22.086Z" } - [[package]] name = "markdown" version = "3.10.2"