Move modules from fluxer_admin_alerts/ to the repository root, switch to absolute imports, fix PROJECT_ROOT resolution, and update README commands and notifier paths.
17 lines
597 B
Python
17 lines
597 B
Python
from __future__ import annotations
|
|
|
|
from config import Settings
|
|
from .base import Message, Notifier, NotifierError
|
|
from .fluxer import FluxerWebhookNotifier
|
|
|
|
__all__ = ["Message", "Notifier", "NotifierError", "build_notifiers"]
|
|
|
|
|
|
def build_notifiers(settings: Settings) -> list[Notifier]:
|
|
notifiers: list[Notifier] = []
|
|
for name in settings.notifiers:
|
|
if name == "fluxer":
|
|
notifiers.append(FluxerWebhookNotifier(settings.fluxer_webhook_url or "", settings.request_timeout))
|
|
else:
|
|
raise ValueError(f"no notifier named {name!r}")
|
|
return notifiers
|