Table of Contents

Class: HappyFormatterBase HappyDoc-r0_7_1/happyformatter.py

Base class for HappyDoc formatters.

Methods   
__init__
_popListContext
_pushListContext
_requiredOfSubclass
_unquoteString
_writeFunctionParameter
closeOutput
descriptiveListFooter
descriptiveListHeader
descriptiveListItem
dividingLine
formatCode
getFullOutputNameForObject
getInternalReference
getNamedReference
getOutputNameForObject
getPythonReference
getReference
itemFooter
itemHeader
listFooter
listHeader
listItem
openOutput
popSectionLevel
pushSectionLevel
sectionFooter
sectionHeader
writeCode
writeExceptionListForFunction
writeFunctionSignature
writeRaw
writeText
  __init__ 
__init__ (
        self,
        docSet,
        **extraNamedParameters,
        )

Initialize the output formatter.

Parameters:

docSet

documentation set controlling this formatter

  _popListContext 
_popListContext ( self )

Remove context from the list context stack.

  _pushListContext 
_pushListContext ( self,  resetCurrentContext )

Add to the list context for nested lists.

  _requiredOfSubclass 
_requiredOfSubclass ( self,  name )

Convenient way to raise a consistent exception.

Exceptions   
AttributeError( '%s is not implemented for this class.' % name, self.__class__.__name__ )

  _unquoteString 
_unquoteString ( self,  str )

Remove surrounding quotes from a string.

  _writeFunctionParameter 
_writeFunctionParameter (
        self,
        name,
        info,
        output,
        )

Write a function parameter to the output.

No indenting or formatting is performed. The output looks like:

            name

or

name=default

Parameters:

name

name of the parameter

info

tuple of (default_specified, default_value, default_value_type) concerning the default value of the parameter

output

destination for written output

  closeOutput 
closeOutput ( self,  output )

Close the output handle.

  descriptiveListFooter 
descriptiveListFooter ( self,  output )

  descriptiveListHeader 
descriptiveListHeader (
        self,
        output,
        title,
        )

  descriptiveListItem 
descriptiveListItem (
        self,
        output,
        item,
        description,
        )

  dividingLine 
dividingLine (
        self,
        output,
        fill='-',
        span=80,
        )

Output a sectional dividing line.

Parameters:

output

destination for written output

fill="-"

character to use to draw the line

span=80

horizontal width of line to draw

  formatCode 
formatCode ( self,  text )

Format text as source code and return the new string.

  getFullOutputNameForObject 
getFullOutputNameForObject ( self,  infoObject )

Get the full name, including path, to the object being output.

  getInternalReference 
getInternalReference ( self,  infoSource )

Return a reference to infoSource within an open documentation node.

Return a string containing a reference which points to the documentation for an object from the current node.

  getNamedReference 
getNamedReference (
        self,
        infoSource,
        name,
        relativeSource,
        )

Return a reference from relativeSource to name within infoSource.

Return a string containing a reference which points to the documentation for name from the node located at relativeSource. The relativeSource parameter is a string naming a node from which the reference should work.

  getOutputNameForObject 
getOutputNameForObject ( self,  infoObject )

Return the base name of the thing to which output should be written for an info source. This is usually a file name, but could be anything understood by the formatter as a name. If infoObject is None, return the name for a root node for this formatter.

  getPythonReference 
getPythonReference ( self,  moduleName )

Return a reference pointing to Python.org.

Return a reference to the standard documentation for a standard Python library module on http://www.python.org.

  getReference 
getReference (
        self,
        infoSource,
        relativeSource,
        )

Return a reference from relativeSource to infoSource.

Return a string containing a reference which points to the documentation for an object from the node located at relativeSource. The relativeSource parameter is a string naming a node from which the reference should work.

  itemFooter 
itemFooter ( self,  output )

  itemHeader 
itemHeader (
        self,
        output,
        title,
        )

  listFooter 
listFooter ( self,  output )

  listHeader 
listHeader (
        self,
        output,
        title,
        allowMultiColumn=1,
        )

  listItem 
listItem (
        self,
        output,
        text,
        )

  openOutput 
openOutput (
        self,
        name,
        title1,
        title2=None,
        )

Open the named output destination and give a title and subtitle.

  popSectionLevel 
popSectionLevel ( self,  output )

  pushSectionLevel 
pushSectionLevel ( self,  output )

  sectionFooter 
sectionFooter ( self,  output )

  sectionHeader 
sectionHeader (
        self,
        output,
        title,
        )

  writeCode 
writeCode (
        self,
        text,
        output,
        )

Write the text to the output formatted as source code.

  writeExceptionListForFunction 
writeExceptionListForFunction (
        self,
        output,
        function,
        listHeader,
        )

Write the list of exceptions raised by a function.

Parameters

output

Where to write.

function

FunctionInfo from parseinfo module.

listHeader

Header for list being generated.

  writeFunctionSignature 
writeFunctionSignature (
        self,
        output,
        function,
        )

Write the function signature for function to output.

Parameters

output

Where to write.

function

Instance of FunctionInfo from parseinfo module.

  writeRaw 
writeRaw (
        self,
        text,
        output,
        )

Write the unaltered text to the output destination.

  writeText 
writeText (
        self,
        text,
        output,
        )

Write the text to the output destination.


Table of Contents

This document was automatically generated on Sat Sep 9 20:27:32 2000 by HappyDoc version r0_7_1