Invoke an event on an addon and all its children.
(self, addon, event: hooks.Hook)
| 272 | await res |
| 273 | |
| 274 | def invoke_addon_sync(self, addon, event: hooks.Hook): |
| 275 | """ |
| 276 | Invoke an event on an addon and all its children. |
| 277 | """ |
| 278 | for addon, func in self._iter_hooks(addon, event): |
| 279 | if inspect.iscoroutinefunction(func): |
| 280 | raise exceptions.AddonManagerError( |
| 281 | f"Async handler {event.name} ({addon}) cannot be called from sync context" |
| 282 | ) |
| 283 | func(*event.args()) |
| 284 | |
| 285 | async def trigger_event(self, event: hooks.Hook): |
| 286 | """ |
no test coverage detected