Unregister a handler with an event. :type event_name: str :param event_name: The name of the event. :type handler: callable :param handler: The callback to unregister. :type unique_id: str :param unique_id: A unique identifier identifying the callba
(
self,
event_name,
handler=None,
unique_id=None,
unique_id_uses_count=False,
)
| 705 | ) |
| 706 | |
| 707 | def unregister( |
| 708 | self, |
| 709 | event_name, |
| 710 | handler=None, |
| 711 | unique_id=None, |
| 712 | unique_id_uses_count=False, |
| 713 | ): |
| 714 | """Unregister a handler with an event. |
| 715 | |
| 716 | :type event_name: str |
| 717 | :param event_name: The name of the event. |
| 718 | |
| 719 | :type handler: callable |
| 720 | :param handler: The callback to unregister. |
| 721 | |
| 722 | :type unique_id: str |
| 723 | :param unique_id: A unique identifier identifying the callback |
| 724 | to unregister. You can provide either the handler or the |
| 725 | unique_id, you do not have to provide both. |
| 726 | |
| 727 | :param unique_id_uses_count: boolean |
| 728 | :param unique_id_uses_count: Specifies if the event should maintain |
| 729 | a count when a ``unique_id`` is registered and unregisted. The |
| 730 | event can only be completely unregistered once every ``register`` |
| 731 | call using the ``unique_id`` has been matched by an ``unregister`` |
| 732 | call. If the ``unique_id`` is specified, subsequent |
| 733 | ``unregister`` calls must use the same value for |
| 734 | ``unique_id_uses_count`` as the ``register`` call that first |
| 735 | registered the event. |
| 736 | |
| 737 | :raises ValueError: If the call to ``unregister`` uses ``unique_id`` |
| 738 | but the value for ``unique_id_uses_count`` differs from the |
| 739 | ``unique_id_uses_count`` value declared by the very first |
| 740 | ``register`` call for that ``unique_id``. |
| 741 | """ |
| 742 | self._events.unregister( |
| 743 | event_name, |
| 744 | handler=handler, |
| 745 | unique_id=unique_id, |
| 746 | unique_id_uses_count=unique_id_uses_count, |
| 747 | ) |
| 748 | |
| 749 | def emit(self, event_name, **kwargs): |
| 750 | return self._events.emit(event_name, **kwargs) |
no outgoing calls