napari.utils.notifications.Notification#

class napari.utils.notifications.Notification(message: str, severity: str | NotificationSeverity = NotificationSeverity.WARNING, actions: Sequence[tuple[str, Callable[[], None]]] = (), **kwargs)[source]#

Bases: Event

A Notifcation event. Usually created by NotificationManager.

Parameters:
  • message (str) – The main message/payload of the notification.

  • severity (str or NotificationSeverity, optional) – The severity of the notification, by default NotificationSeverity.WARNING.

  • actions – Where each tuple is a (str, callable) 2-tuple where the first item is a name for the action (which may, for example, be put on a button), and the callable is a callback to perform when the action is triggered. (for example, one might show a traceback dialog). by default ()

Methods

from_exception(exc, **kwargs)

from_warning(warning, **kwargs)

Attributes

blocked

This boolean property indicates whether the event will be delivered to event callbacks.

handled

This boolean property indicates whether the event has already been acted on by an event handler.

message

native

source

The object that the event applies to (i.e. the source of the event).

sources

List of objects that the event applies to (i.e. are or have been a source of the event).

type

Details