desktop

Module for the Desktop messenger.

This module defines the Desktop messenger class, which is used to send OS-native desktop notifications.

Typical usage example:

from herald.decorators import Herald
from herald.messengers import DesktopMessenger

herald = Herald(".env")
desktop = DesktopMessenger()

@herald(desktop)
def my_function():
    pass

Classes

DesktopMessenger

A class used to send OS-native desktop notifications.

class DesktopMessenger[source]

Bases: Messenger

A class used to send OS-native desktop notifications.

__init__()[source]

Initializes the DesktopMessenger class.

set_secrets(secrets)[source]

Sets the secrets for the DesktopMessenger class.

Must be implemented as a result of inheriting from the Messenger class. However, the DesktopMessenger itself does not require any secrets.

Parameters:

secrets (Secrets) – Secrets to be used by the messenger.

Return type:

None

notify(info)[source]

Constructs and sends a desktop notification using the function information.

Parameters:

info (TaskInfo) – TaskInfo object containing information about the function. Contents should be used to construct the notification message.

Return type:

None