Synopsis - Synopsis.Formatters.HTML.View.View

module Synopsis.Formatters.HTML.View
class View
File: ../Synopsis/Formatters/HTML/View.py
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.
Attributes Summary:
main
Class attributes Summary:
template
Methods Summary:
__init__(self, * * kwds)
register(self, frame)
Registers this View class with its frame.
filename(self)
Return the filename (currently) associated with the view.
title(self)
Return the title (currently) associated with the view.
root(self)
Return a pair of (url, label) to link to the entry point of this view.
write_navigation_bar(self)
Generate a navigation bar for this view.
os(self)
write(self, str)
register_filenames(self)
Register filenames for each file this View will generate.
toc(self)
Retrieves the TOC for this view.
process(self)
Process the ASG, creating view-specific html pages.
open_file(self)
Returns a new output stream.
close_file(self)
Closes the internal output stream.
start_file(self, body = '', headextra = '')
Start a new file with given filename, title and body.
end_file(self, body = '</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:
register(self, frame)
Registers this View class with its frame.
filename(self)
Return the filename (currently) associated with the view.
title(self)
Return the title (currently) associated with the view.
root(self)
Return a pair of (url, label) to link to the entry point of this view.
write_navigation_bar(self)
Generate a navigation bar for this view.
os(self)
Returns the output stream opened with start_file
write(self, str)
Writes the given string to the currently opened file
register_filenames(self)
Register filenames for each file this View will generate.
toc(self)
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(self)
Process the ASG, creating view-specific html pages.
open_file(self)
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()
close_file(self)
Closes the internal output stream. This template method is for internal use only, but may be overriden in derived classes.
start_file(self, body = '', headextra = '')
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.
end_file(self, body = '</body>')
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.
Generated on Thu Apr 16 16:27:01 2009 by
synopsis (version devel)