class documentation

class PagesView(IndexView): (source)

View In Hierarchy

Index view that exposes the "pages" table in the index
Method __init__ Undocumented
Method create_link Determine best way to represent a link between two pages
Method get_has_previous_has_next Undocumented
Method get_next No summary
Method get_previous No summary
Method list_pages Generator for child pages of path @returns: yields Path objects for children of path @raises IndexNotFoundError: if path is not found in the index
Method list_recent_changes Undocumented
Method lookup_by_pagename Undocumented
Method lookup_from_user_input No summary
Method match_all_pages Like match_pages() except not limited a specific namespace
Method match_pages No summary
Method n_all_pages
Method n_list_pages
Method resolve_link No summary
Method walk Generator function to yield all pages in the index, depth first
Method walk_bottomup Undocumented
Method _find_floating_link Undocumented
Method _list_pages Undocumented
Method _match_pages Undocumented
Instance Variable _pages Undocumented

Inherited from IndexView:

Class Method new_from_index Undocumented
Instance Variable db Undocumented
def __init__(self, db): (source)

Undocumented

Parameters
db:sqlite3.ConnectionUndocumented
def create_link(self, source, target): (source)
Determine best way to represent a link between two pages
Parameters
source:PathUndocumented
target:PathUndocumented
Returns
HRefUndocumented
def get_has_previous_has_next(self, path): (source)

Undocumented

Parameters
path:PathUndocumented
Returns
boolUndocumented
def get_next(self, path): (source)
Get the next path in the index, in the same order that walk() will yield them
Parameters
path:PathUndocumented
Returns
Optional[Path]a Path object or None if path is the last page in the index
def get_previous(self, path): (source)
Get the previous path in the index, in the same order that walk() will yield them
Parameters
path:PathUndocumented
Returns
Optional[Path]a Path object or None if {path} is the first page in the index
def list_pages(self, path=None): (source)
Generator for child pages of path
Parameters
path:Optional[Path]Undocumented
Returns
Generator[PageIndexRecord, None, None]yields Path objects for children of path
Raises
IndexNotFoundErrorif path is not found in the index
def list_recent_changes(self, limit=None, offset=None): (source)

Undocumented

Parameters
limit:Optional[int]Undocumented
offset:Optional[int]Undocumented
Returns
Generator[PageIndexRecord, None, None]Undocumented
def lookup_by_pagename(self, pagename): (source)

Undocumented

Parameters
pagename:PathUndocumented
Returns
PageIndexRecordUndocumented
def lookup_from_user_input(self, name, reference=None): (source)
Lookup a pagename based on user input
Parameters
name:strthe user input as string
reference:Patha Path in case relative links are supported as customer input
Returns
Patha Path object for name
Raises
ValueErrorwhen name would reduce to empty string after removing all invalid characters, or if name is a relative link while no reference page is given.
IndexNotFoundErrorwhen reference is not indexed
def match_all_pages(self, text, limit=10): (source)
Like match_pages() except not limited a specific namespace
Parameters
text:strUndocumented
limit:intUndocumented
Returns
Generator[PageIndexRecord, None, None]Undocumented
def match_pages(self, path, text, limit=10): (source)
Generator for child pages of path that match text in their name
Parameters
path:PathUndocumented
text:strUndocumented
limit:intmax number of results
Returns
Generator[PageIndexRecord, None, None]yields Path objects for children of path
Raises
IndexNotFoundErrorif path is not found in the index
def n_all_pages(self): (source)
Returns
inttotal number of pages in the index
def n_list_pages(self, path=None): (source)
Parameters
path:Optional[Path]optional, defaults to root path
Returns
intnumber of child pages of path.
def resolve_link(self, source, href): (source)
Find the end point of a link Depending on the link type (absolute, relative, or floating), this method first determines the starting point of the link path. Then it goes downward doing a case insensitive match against the index.
Parameters
source:Patha Path for the starting point of the link
href:HRefa HRef object for the link
Returns
Patha Path object for the target of the link.
def walk(self, path=None): (source)
Generator function to yield all pages in the index, depth first
Parameters
path:Optional[Path]a Path object for the starting point, can be used to only iterate a sub-tree. When this is None the whole notebook is iterated over
Returns
Generator[PageIndexRecord, None, None]an iterator that yields Path objects
Raises
IndexNotFoundErrorif path does not exist in the index
def walk_bottomup(self, path=None): (source)

Undocumented

Parameters
path:Optional[Path]Undocumented
Returns
Generator[PageIndexRecord, None, None]Undocumented
def _find_floating_link(self, source, target): (source)

Undocumented

Parameters
source:PathUndocumented
target:PathUndocumented
Returns
Optional[Path]Undocumented
def _list_pages(self, page_id): (source)

Undocumented

Parameters
page_id:intUndocumented
def _match_pages(self, page_id, text, limit): (source)

Undocumented

Parameters
page_id:intUndocumented
text:strUndocumented
limit:intUndocumented
_pages = (source)

Undocumented