Remove a callback from the given event.
(self, event: str, function: Callable[..., Any])
| 83 | self.callbacks[event].append(function) |
| 84 | |
| 85 | def unregister(self, event: str, function: Callable[..., Any]) -> None: |
| 86 | """Remove a callback from the given event.""" |
| 87 | if function in self.callbacks[event]: |
| 88 | return self.callbacks[event].remove(function) |
| 89 | |
| 90 | raise ValueError('Function {!r} is not registered as a {} callback'.format(function, event)) |
| 91 | |
| 92 | def trigger(self, event: str, *args: Any, **kwargs: Any) -> None: |
| 93 | """Call callbacks for ``event``. |