MCPcopy
hub / github.com/mitmproxy/mitmproxy / invoke_addon_sync

Method invoke_addon_sync

mitmproxy/addonmanager.py:274–283  ·  view source on GitHub ↗

Invoke an event on an addon and all its children.

(self, addon, event: hooks.Hook)

Source from the content-addressed store, hash-verified

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 """

Callers 8

clearMethod · 0.95
registerMethod · 0.95
removeMethod · 0.95
triggerMethod · 0.95
configureMethod · 0.80
loadscriptMethod · 0.80
script_runMethod · 0.80
configureMethod · 0.80

Calls 2

_iter_hooksMethod · 0.95
argsMethod · 0.80

Tested by

no test coverage detected