Base class for Views. The base class provides a common interface, and
also handles common operations such as opening the file, and delegating
the view formatting to a strategy class.
Methods Summary:
Registers this View class with its frame.
Return the filename (currently) associated with the view.
Return the title (currently) associated with the view.
Return a pair of (url, label) to link to the entry point of this view.
Generate a navigation bar for this view.
Register filenames for each file this View will generate.
Retrieves the TOC for this view.
Process the ASG, creating view-specific html pages.
Returns a new output stream.
Closes the internal output stream.
Start a new file with given filename, title and body.
Close the file using given close body tag.
reference(
self,
name,
scope,
label =
None,
* * keys)
Returns a reference to the given name.
Methods Details:
Registers this View class with its frame.
Return the filename (currently) associated with the view.
Return the title (currently) associated with the view.
Return a pair of (url, label) to link to the entry point of this view.
Generate a navigation bar for this view.
Returns the output stream opened with start_file
Writes the given string to the currently opened file
Register filenames for each file this View will generate.
Retrieves the TOC for this view. This method assumes that the view
generates info for the the whole ASG, which could be the Scope,
the Source (source code) or the XRef (cross reference info).
The default implementation returns None.
Process the ASG, creating view-specific html pages.
Returns a new output stream. This template method is for internal
use only, but may be overriden in derived classes.
The default joins output dir and self.filename()
Closes the internal output stream. This template method is for
internal use only, but may be overriden in derived classes.
Start a new file with given filename, title and body. This method
opens a file for writing, and writes the html header crap at the top.
You must specify a title, which is prepended with the project name.
The body argument is optional, and it is preferred to use stylesheets
for that sort of stuff. You may want to put an onLoad handler in it
though in which case that's the place to do it. The opened file is
stored and can be accessed using the os() method.
Close the file using given close body tag. The default is
just a close body tag, but if you specify '' then nothing will be
written (useful for a frames view)
reference(
self,
name,
scope,
label =
None,
* * keys)
Returns a reference to the given name. The name is a scoped name,
and the optional label is an alternative name to use as the link text.
The name is looked up in the TOC so the link may not be local. The
optional keys are appended as attributes to the A tag.