This class manages and coordinates the various pages. The user adds pages by passing their class object to the addPage method. Pages should be derived from Page.Page, and their constructors may want to call the addRootPage method of the PageManager object to register a name and link that is listed along with other root or top-level pages.
Operations Summary: | |
__init__(self) [Source] | |
getPage(self, name) Returns the Page with the given name [Source] | |
globalScope(self) Return the global scope [Source] | |
calculateStart(self, root, namespace = None) Calculates the start scope using the 'namespace' config var [Source] | |
addPage(self, pageClass) Add a page of the given class. [Source] | |
addRootPage(self, file, label, target, visibility) Adds a named link to the list of root pages. [Source] | |
formatHeader(self, origin, visibility = 1) Formats the list of root pages to HTML. [Source] | |
process(self, root) Create all pages from the start Scope, derived from the root Scope [Source] | |
_loadPages(self) Loads the page objects from the config.pages list. [Source] | |
register_filename(self, filename, page, scope) Registers a file for later production. [Source] | |
filename_info(self, filename) Returns information about a registered file, as a (page,scope) pair. [Source] |
Operation Details: |
Add a page of the given class. An instance is created and stored, and its root() method is called and the name,link tuple stored if None isn't returned.
Adds a named link to the list of root pages. Called from the constructors of Page objects. The root pages are displayed at the top of every page, depending on their visibility (higher = more visible).
Formats the list of root pages to HTML. The origin specifies the generated page itself (which shouldn't be linked), such that the relative links can be generated. Only root pages of 'visibility' or above are included.
Loads the page objects from the config.pages list. Each element is either a string or a tuple of two strings. One string means load the named module and look for a 'htmlPageClass' attribute in it. A tuple of two strings means load the module from the first string, and look for an attribute using the second string.
Registers a file for later production. The first page to register the filename gets to keep it.
Returns information about a registered file, as a (page,scope) pair. Will return None if the filename isn't registered.