Module BaseDoc :: Class BaseDoc
[frames] | no frames]

Class BaseDoc

source code

Base class for document generators. Different output formats, such as OpenOffice, AbiWord, and LaTeX are derived from this base class, providing a common interface to all document generators.

Instance Methods
 
__init__(self, styles, paper_style, template)
Create a BaseDoc instance, which provides a document generation interface.
source code
 
init(self) source code
 
print_requested(self) source code
 
set_creator(self, name)
Set the owner name
source code
 
get_creator(self)
Return the owner name
source code
 
get_style_sheet(self)
Return the StyleSheet of the document.
source code
 
set_style_sheet(self, style_sheet)
Set the StyleSheet of the document.
source code
 
open(self, filename)
Opens the document.
source code
 
close(self)
Closes the document
source code
Method Details

__init__(self, styles, paper_style, template)
(Constructor)

source code 

Create a BaseDoc instance, which provides a document generation interface. This class should never be instantiated directly, but only through a derived class.

Parameters:
  • styles - StyleSheet containing the styles used.
  • paper_style - PaperStyle instance containing information about the paper. If set to None, then the document is not a page oriented document (e.g. HTML)
  • template - Format template for document generators that are not page oriented.

set_style_sheet(self, style_sheet)

source code 

Set the StyleSheet of the document.

Parameters:
  • style_sheet (StyleSheet) - The new style sheet for the document

open(self, filename)

source code 

Opens the document.

Parameters:
  • filename - path name of the file to create