maestral.notify =============== .. py:module:: maestral.notify .. autoapi-nested-parse:: This module handles desktop notifications It uses the `desktop-notifier `_ package as a backend for cross-platform desktop notifications. Module Contents --------------- .. py:data:: NONE :value: 100 No desktop notifications .. py:data:: ERROR :value: 40 Notify only on fatal errors .. py:data:: SYNCISSUE :value: 30 Notify for sync issues and higher .. py:data:: FILECHANGE :value: 15 Notify for all remote file changes .. py:function:: level_number_to_name(number) Converts a Maestral notification level number to name. :param number: Level number. :returns: Level name. .. py:function:: level_name_to_number(name) Converts a Maestral notification level name to number. :param name: Level name. :returns: Level number. .. py:class:: MaestralDesktopNotifier(config_name, event_loop) Desktop notification emitter for Maestral Desktop notifier with snooze functionality and variable notification levels. Must be instantiated in the main thread. :param config_name: Config name. This is used to access notification settings for the daemon. :param event_loop: Event loop to use to send notifications and receive callbacks. .. py:property:: notify_level :type: int Custom notification level. Notifications with a lower level will be discarded. .. py:property:: snoozed :type: float Time in minutes to snooze notifications. Applied to FILECHANGE level only. .. py:method:: notify(title, message, level = FILECHANGE, on_click = None, actions = None) Sends a desktop notification. This will schedule a notification task in the asyncio loop of the thread where :class:`DesktopNotifier` was instantiated. :param title: Notification title. :param message: Notification message. :param level: Notification level of the message. :param on_click: A callback to execute when the notification is clicked. The provided callable must not take any arguments. :param actions: A dictionary with button names and callbacks for the notification.