| 333 | |
| 334 | |
| 335 | class CapturingDisplayHook: |
| 336 | def __init__(self, shell, outputs=None): |
| 337 | self.shell = shell |
| 338 | if outputs is None: |
| 339 | outputs = [] |
| 340 | self.outputs = outputs |
| 341 | |
| 342 | def __call__(self, result=None): |
| 343 | if result is None: |
| 344 | return |
| 345 | format_dict, md_dict = self.shell.display_formatter.format(result) |
| 346 | self.outputs.append({ 'data': format_dict, 'metadata': md_dict }) |
no outgoing calls
searching dependent graphs…