dmf.alerts.backend.AlertBackend#

class dmf.alerts.backend.AlertBackend(fail_silently: bool = True)[source]#

Bases: object

Base class for alert backends.

__init__(fail_silently: bool = True) None[source]#

Methods

__init__([fail_silently])

get_alert_text([text, level, params, separator])

Format the notification text with the given arguments.

send_alert([text, attachment, params, level])

Send a notification with a template message.

send_message([text, attachment, scheduled_time])

Placeholder method to be implemented by subclasses.

get_alert_text(text: str | None = None, level: Literal['success', 'info', 'warning', 'error'] = 'info', params: dict | None = None, separator: str = '\n      ') str[source]#

Format the notification text with the given arguments.

send_alert(text: str | None = None, attachment: str | Path | None = None, params: dict | None = None, level: Literal['success', 'info', 'warning', 'error'] = 'info') None[source]#

Send a notification with a template message.

send_message(text: str = '', attachment: str | Path | None = None, scheduled_time: int | datetime | None = None) None[source]#

Placeholder method to be implemented by subclasses.