desktop_notifier.macos_legacy
#
NSUserNotificationCenter backend for macOS.
Should be used for macOS 10.13 and earlier.
Deprecated but still available in macOS 11.0.
Requires a running CFRunLoop to invoke callbacks.
Module Contents#
Classes#
NSUserNotificationCenter backend for macOS |
- class desktop_notifier.macos_legacy.CocoaNotificationCenterLegacy(app_name='Python', notification_limit=None)[source]#
Bases:
desktop_notifier.base.DesktopNotifierBase
NSUserNotificationCenter backend for macOS
Should be used for macOS High Sierra and earlier. Supports only a single button per notification. Both app name and bundle identifier will be ignored. The notification center automatically uses the values provided by the app bundle or the Python framework.
- 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]#
Uses NSUserNotificationCenter to schedule a notification.
- Parameters:
notification (desktop_notifier.base.Notification) – Notification to send.
notification_to_replace (Optional[desktop_notifier.base.Notification]) – Notification to replace, if any.
- Return type:
- async _clear(notification)[source]#
Removes a notifications from the notification center
- Parameters:
notification (desktop_notifier.base.Notification) – Notification to clear.
- Return type:
None