MCPcopy Create free account
hub / github.com/ipython/ipython / trigger

Method trigger

IPython/core/events.py:80–91  ·  view source on GitHub ↗

Call callbacks for ``event``. Any additional arguments are passed to all callbacks registered for this event. Exceptions raised by callbacks are caught, and a message printed.

(self, event, *args, **kwargs)

Source from the content-addressed store, hash-verified

78 raise ValueError('Function {!r} is not registered as a {} callback'.format(function, event))
79
80 def trigger(self, event, *args, **kwargs):
81 """Call callbacks for ``event``.
82
83 Any additional arguments are passed to all callbacks registered for this
84 event. Exceptions raised by callbacks are caught, and a message printed.
85 """
86 for func in self.callbacks[event][:]:
87 try:
88 func(*args, **kwargs)
89 except (Exception, KeyboardInterrupt):
90 print("Error in callback {} (for {}):".format(func, event))
91 self.shell.showtraceback()
92
93# event_name -> prototype mapping
94available_events = {}

Callers 9

__init__Method · 0.80
run_cellMethod · 0.80
run_cell_asyncMethod · 0.80
test_cb_errorMethod · 0.80
run_codeMethod · 0.80

Calls 2

showtracebackMethod · 0.80
formatMethod · 0.45