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¶
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:
- async request_authorisation()[source]¶
Request authorisation to send notifications.
- Returns:
Whether authorisation has been granted.
- Return type:
- async has_authorisation()[source]¶
Whether we have authorisation to send notifications.
- Return type:
- async _send(notification, notification_to_replace)[source]¶
Asynchronously sends a notification.
- Parameters:
notification (desktop_notifier.base.Notification) – Notification to send.
notification_to_replace (desktop_notifier.base.Notification | None) – Notification to replace, if any.
- Return type:
None
- async _clear(notification)[source]¶
Asynchronously removes a notification from the notification center.
- Parameters:
notification (desktop_notifier.base.Notification)
- Return type:
None