Previous Next blank.gif blank.gif

Class SeriesDocument - Primary container class for an HTML document as part of a series.


SYNOPSIS

import HTMLgen
class SeriesDocument(SimpleDocument)
  string __module__ = 'HTMLgen'
  def __str__(self)
  string author = 'Micky Mouse'
  tuple banner = ('/image/banner.gif', 472, 30)
  tuple blank = ('../image/blank.gif', 71, 19)
  string email = 'micky@disney.com'
  def footer(self)
  None alinkcolor = None
  None alinkcolor = None
  None alinkcolor = None
  None alinkcolor = None
  def header(self)
  tuple home = ('../image/BTN_HomePage.gi ...
  tuple logo = ('/image/logo.gif', 36, 35)
  def nav_buttons(self)
  tuple next = ('../image/BTN_NextPage.gi ...
  string place_nav_buttons = 'yes'
  tuple prev = ('../image/BTN_PrevPage.gi ...
  None alinkcolor = None
  tuple top = ('../image/BTN_ManualTop.g ...
  string zone = ' Central US'

  # Methods inherited by SeriesDocument from SimpleDocument
  def __init__(self, resource = None, **kw)
  def html_body_tag(self)
  def html_head(self)

  # Methods inherited by SeriesDocument from BasicDocument
  def append(self, *items)
  def append_file(self, filename, marker_function = None)
  def copy(self)
  def prepend(self, *items)
  def write(self, filename = None)
alias Document = SeriesDocument

DESCRIPTION

Formerly known as Document().

Navigation mechanisms are provided.

Single optional string argument for the path to a resource file used to specify document parameters. This helps minimize the need for subclassing from this class. Keyword parameters may be used for any of the following class attributes. See HTMLtest.py for example usage.

def append(self, *items)

Add content to the Document object.

Arg items can be plain text or objects; multiple arguments supported.

def append_file(self, filename, marker_function = None)

Add the contents of a file to the document.

filename
the filename of the file to be read [string]
marker_function
a callable object which the text read from the file will be passed through before being added to the document.

def copy(self)

Return a complete copy of the current Document object.

def footer(self)

Generate the standard footer markups.

def header(self)

Generate the standard header markups.

def html_body_tag(self)

Return BODY tag with attributes.

def html_head(self)

Generate the HEAD TITLE and BODY tags.

def nav_buttons(self)

Generate hyperlinked navigation buttons.

If a self.go* attribute is null that corresponding button is replaced with a transparent gif to properly space the remaining buttons.

def prepend(self, *items)

Add content to the beginning of the Document object.

Arg items can be plain text or objects; multiple arguments supported.

def write(self, filename = None)

Emit the Document HTML to a file or standard output.

In Unix you can use environment variables in filenames. Will print to stdout if no argument.

Class instance attributes and keyword arguments

base
object of the Base class
meta
object of the Meta class
cgi
if non zero will issue a mime type of text/html
logo
('filename', width, height) All images are specified with a tuple of string, int, int. If the size of the graphic is unknown, use 0, 0. This one is the little graphic on the footer of each page.
banner
('filename', width, height) Banner graphic at the top of page. Can also be set to a string filename or an Image object. Can be autosized if it's a GIF.
title
string to be used as the document title.
subtitle
string to be used as the document subtitle. If non-nil, this string will be used for the doc title instead of title.
author
String used in the copyright notice
email
Email address for feedback mailto: tag
zone
string used to label the time zone if datetime is used. By default not used.
bgcolor
Color string (can use variables from HTMLcolors.py)
background
string filename of a graphic used as the doc background.
textcolor
Color string used for text. (can use variables from HTMLcolors.py)
linkcolor
Color string used for hyperlinked text.
vlinkcolor
Color string used for visited hypertext.
alinkcolor
Color string used for active hypertext.
place_nav_buttons
Flag to enable/disable the use of navigation buttons. Default is on. Set to 0 to disable.
blank
Image tuple for the transparent spacer gif
prev
Image tuple for the Previous Page button
next
Image tuple for the Next Page button
top
Image tuple for the Top of Manual button
home
Image tuple for the site Home Page button
goprev
URL string for the prev button
gonext
URL string for the next button
gotop
URL string for the top button
gohome
URL string for the home button
script
a single or list of Script objects to be included in the <HEAD>
onLoad
Script, which is executed when the document is loaded
onUnload
Script, which is executed when the document is unloaded

SEE ALSO

HTMLgen

SimpleDocument


Previous Next blank.gif blank.gif
Buzz.gif

Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedrich@pythonpros.com
Generated: Tue Apr 20, 1999