MCPcopy
hub / github.com/mitmproxy/mitmproxy / trigger

Method trigger

mitmproxy/addonmanager.py:296–308  ·  view source on GitHub ↗

Trigger an event across all addons. This API is discouraged and may be deprecated in the future. Use `trigger_event()` instead, which provides the same functionality but supports async hooks.

(self, event: hooks.Hook)

Source from the content-addressed store, hash-verified

294 return
295
296 def trigger(self, event: hooks.Hook):
297 """
298 Trigger an event across all addons.
299
300 This API is discouraged and may be deprecated in the future.
301 Use `trigger_event()` instead, which provides the same functionality but supports async hooks.
302 """
303 for i in self.chain:
304 try:
305 with safecall():
306 self.invoke_addon_sync(i, event)
307 except exceptions.AddonHalt:
308 return

Callers 15

test_haltFunction · 0.95
test_nestingFunction · 0.95
_configure_allMethod · 0.95
test_mixed_async_syncFunction · 0.80
test_simpleFunction · 0.80
test_simpleMethod · 0.80
test_exceptionMethod · 0.80
setvalue_toggleMethod · 0.80
setvalueMethod · 0.80
resumeMethod · 0.80
markMethod · 0.80
mark_toggleMethod · 0.80

Calls 2

invoke_addon_syncMethod · 0.95
safecallFunction · 0.85

Tested by 6

test_haltFunction · 0.76
test_nestingFunction · 0.76
test_mixed_async_syncFunction · 0.64
test_simpleFunction · 0.64
test_simpleMethod · 0.64
test_exceptionMethod · 0.64