##// END OF EJS Templates
Update Widget Events.ipynb...
Update Widget Events.ipynb Running Widget Events.ipynb in http://try.jupyter.org/ raises the following errors: In [11]: AttributeError: 'module' object has no attribute 'link' In [12]: AttributeError: 'module' object has no attribute 'dlink' In [13]: widgets.<Tab> shows 'jsdlink' and 'jslink', which generate the expected linked sliders.

File last commit:

r18606:776d1fa8
r20599:ef7a03b9
Show More
notebooknode.py
21 lines | 535 B | text/x-python | PythonLexer
"""NotebookNode - adding attribute access to dicts"""
from IPython.utils.ipstruct import Struct
class NotebookNode(Struct):
"""A dict-like node with attribute-access"""
pass
def from_dict(d):
"""Convert dict to dict-like NotebookNode
Recursively converts any dict in the container to a NotebookNode
"""
if isinstance(d, dict):
return NotebookNode({k:from_dict(v) for k,v in d.items()})
elif isinstance(d, (tuple, list)):
return [from_dict(i) for i in d]
else:
return d