Skip to content

_null

_null

No-op notifier for headless environments without a D-Bus session bus.

NullNotifier

Silent fallback that satisfies the Notifier protocol.

Every method is a no-op. notify always returns 0.

notify(summary, body='', *, actions=(), timeout_ms=-1, hints=None, replaces_id=0, app_icon='') async

Accept and discard a notification, returning 0.

Source code in src/terok_dbus/_null.py
async def notify(
    self,
    summary: str,
    body: str = "",
    *,
    actions: Sequence[tuple[str, str]] = (),
    timeout_ms: int = -1,
    hints: Mapping[str, Any] | None = None,
    replaces_id: int = 0,
    app_icon: str = "",
) -> int:
    """Accept and discard a notification, returning ``0``."""
    return 0

on_action(notification_id, callback) async

Accept and discard an action callback registration.

Source code in src/terok_dbus/_null.py
async def on_action(
    self,
    notification_id: int,
    callback: Callable[[str], None],
) -> None:
    """Accept and discard an action callback registration."""

close(notification_id) async

Accept and discard a close request.

Source code in src/terok_dbus/_null.py
async def close(self, notification_id: int) -> None:
    """Accept and discard a close request."""

disconnect() async

Accept and discard a teardown request.

Source code in src/terok_dbus/_null.py
async def disconnect(self) -> None:
    """Accept and discard a teardown request."""