desktop_notifier.winrt

Notification backend for Windows. Unlike other platforms, sending rich “toast” notifications cannot be done via FFI / ctypes because the C winapi only supports basic notifications with a title and message. This backend therefore requires interaction with the Windows Runtime and uses the winrt package with compiled components published by Microsoft (https://github.com/microsoft/xlang, https://pypi.org/project/winrt/).

Module Contents

Classes

WinRTDesktopNotifier

Notification backend for the Windows Runtime

class desktop_notifier.winrt.WinRTDesktopNotifier(app_name='Python', notification_limit=None)[source]

Bases: desktop_notifier.base.DesktopNotifierBase

Notification backend for the Windows Runtime

Parameters:
  • app_name (str) – The name of the app. This has no effect since the app name will be automatically determined.

  • notification_limit (int | None) – Maximum number of notifications to keep in the system’s notification center.

_to_native_urgency[source]
DEFAULT_ACTION = 'default'[source]
REPLY_ACTION = 'action=reply&amp'[source]
BUTTON_ACTION_PREFIX = 'action=button&id='[source]
REPLY_TEXTBOX_NAME = 'textBox'[source]
async request_authorisation()[source]

Request authorisation to send notifications.

Returns:

Whether authorisation has been granted.

Return type:

bool

async has_authorisation()[source]

Whether we have authorisation to send notifications.

Return type:

bool

async _send(notification, notification_to_replace)[source]

Asynchronously sends a notification.

Parameters:
Return type:

None

async _clear(notification)[source]

Asynchronously removes a notification from the notification center.

Parameters:

notification (desktop_notifier.base.Notification)

Return type:

None

async _clear_all()[source]

Asynchronously clears all notifications from notification center.

Return type:

None