##// END OF EJS Templates
allow users to set scroll state...
allow users to set scroll state and persist that state in metadata. When user toggles the scroll state, the choice is remembered and persisted. There are three states: - 'auto' (default, only state in master) - true (always scroll if above minimum_scroll_threshold) - false (never scroll) true or false is persisted in cell.metadata.scrolled. "auto" may be persisted, but isn't currently because it's the default state.

File last commit:

r18606:776d1fa8
r20058:b237ec78
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