class documentation

class History(SignalEmitter): (source)

View In Hierarchy

History class, keeps track of a list of HistoryPath objects. Also has a 'current' page which should match the current page in the interface. The current page normally is the latest page in the list, but when the user navigates back in the history it can be another position.
Unknown Field: signal
changed (): emitted when the path list changed
Method __init__ No summary
Method append No summary
Method get_child No summary
Method get_current Get current path @returns: a HistoryPath object
Method get_grandchild No summary
Method get_history Generator function that yields history records, latest first @returns: yields HistoryPath objects
Method get_next Get the next path @returns: a HistoryPath object or None if current is already the last path in the list
Method get_previous Get the previous path @returns: a HistoryPath object or None if current is already the first path in the list
Method get_recent Generator function that yields recent pages @returns: yields RecentPath objects
Method get_state No summary
Method set_current No summary
Method set_state No summary
Class Variable __signals__ Undocumented
Instance Variable notebook the Notebook
Instance Variable uistate the ConfigDict used to store the history
Method _on_page_deleted Undocumented
Method _on_page_moved Undocumented
Method _update_recent Undocumented
Instance Variable _current Undocumented
Property _history Undocumented
Property _recent Undocumented

Inherited from SignalEmitter:

Method __new__ Undocumented
Method block_signals Returns a context manager for blocking one or more signals
Method connect Register a handler for a specific object.
Method connect_after Like connect() but handler will be called after default handler
Method disconnect Undocumented
Method emit Undocumented
Method emit_return_first Emits a signal and stops emission on the first handler that returns a not-None value.
Method emit_return_iter Returns an generator that calls one handler on each iteration and yields the return values. This allows aggregating return values.
Method _connect Undocumented
Method _setup_signal Undocumented
Method _teardown_signal Undocumented
def __init__(self, notebook, uistate=None): (source)
Constructor
Parameters
notebooka Notebook object
uistateSectionedConfigDict to store the history (history will use the 'History' section in ConfigDict)
def append(self, path): (source)
Append a new page to the history. Will drop the forward stack and make this page the latest page.
Parameters
pathPath for the current page
Unknown Field: emits
changed
def get_child(self, path): (source)
Get the most recent path that is a direct child of the given path. If there is a recent grand-child of the given path in the history, that will be used as a bases to get a new Path object. Used by the keybinding for navigating to child pages.
Parameters
patha Path object
Returns
a HistoryPath or Path object or None
def get_current(self): (source)
Get current path
Returns
a HistoryPath object
def get_grandchild(self, path): (source)
Get the deepest nested grand-child of a given path. Used for the 'namespace' pathbar to keep showing child pages when the user navigates up.
Parameters
patha Path object
Returns
a HistoryPath object or None
def get_history(self): (source)
Generator function that yields history records, latest first
Returns
yields HistoryPath objects
def get_next(self): (source)
Get the next path
Returns
a HistoryPath object or None if current is already the last path in the list
def get_previous(self): (source)
Get the previous path
Returns
a HistoryPath object or None if current is already the first path in the list
def get_recent(self): (source)
Generator function that yields recent pages
Returns
yields RecentPath objects
def get_state(self, path): (source)
Looks through the history and recent pages to the last known cursor position for a page.
Parameters
patha Path object
Returns
a tuple of cursor and scroll position for path or (None, None)
def set_current(self, path): (source)
Set current path (changes the pointer, does not change the list of pages)
Parameters
patha HistoryPath object
Raises
ValueErrorwhen the path is not in the history list
def set_state(self, path, cursor, scroll): (source)
Looks through the history and recent pages to set the last known cursor position for a page.
Parameters
patha Path object
cursorcursor position
scrollscroll position
__signals__ = (source)

Undocumented

notebook = (source)
the Notebook
uistate = (source)
the ConfigDict used to store the history
def _on_page_deleted(self, nb, page): (source)

Undocumented

def _on_page_moved(self, nb, oldpath, newpath): (source)

Undocumented

def _update_recent(self, path): (source)

Undocumented

_current = (source)

Undocumented

@property
_history = (source)

Undocumented

@property
_recent = (source)

Undocumented