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

Class CapturingDisplayHook

IPython/core/displayhook.py:314–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312
313
314class CapturingDisplayHook(object):
315 def __init__(self, shell, outputs=None):
316 self.shell = shell
317 if outputs is None:
318 outputs = []
319 self.outputs = outputs
320
321 def __call__(self, result=None):
322 if result is None:
323 return
324 format_dict, md_dict = self.shell.display_formatter.format(result)
325 self.outputs.append({ 'data': format_dict, 'metadata': md_dict })

Callers 2

__enter__Method · 0.90

Calls

no outgoing calls

Tested by 1