formatter

Revision 18 as of 2014-04-06 07:49:36

Clear message

formatter

Formatter module supporting pydoc2 - contains classes for walking the data structures, and generating output as appropriate

  • 23 Mar - using the new analyser module

No functions defined within this module

CLASSES

formatterError Class

  • ||

    <<style='border:none;'>formatter.formatterError( msg)|| Derived From :

BaseException||

Properties

  • formatterError.args Read Only

    formatterError.message Read Only

InvalidDictionaryError Class

  • ||

    <<style='border:none;'>formatter.InvalidDictionaryError( msg)|| Derived From :

formatterError||

Properties

  • InvalidDictionaryError.args Read Only

    InvalidDictionaryError.message Read Only

DataWalker Class

  • <<style='border:none;'>formatter.DataWalker( options=None)

    • Base class to walk the various entries in the data for a single module

      This is subclassed by Formatter classes

Methods

  • DataWalker.TraverseProperty( prop, depth=1, line=False, method=False)

    DataWalker.TraverseFunction( func, depth=1, line=False, method=False)

    DataWalker.TraverseClass( cls, depth=1)

    DataWalker.TraverseModule( depth=1)

HtmlFormatter Class

  • ||

    <<style='border:none;'>formatter.HtmlFormatter( module='', directory='', error='', options=None, autoclose=True, OutputStream='stdout')|| Derived From :

DataWalker||

  • Format the data as a html page

    OutputStream : Must be a fileType object - for instance an open file or a StringIO
    module : the absolute filename of the module to be displayed
    directory : the absolute path of the directory to be displayed
    error : A dictionary with details of the error to be displayed
    options : The options namescpace created from parse-arg
    autoclose : Whether the formatter should automatically close the file when finished.
    Where the OutputStream is StringIO this will probably need to be false.

Methods

  • HtmlFormatter.TraverseProperty( prop, depth=1, line=False, method=False)

    HtmlFormatter.TraverseFunction( func, depth=1, line=False, method=False)

    HtmlFormatter.TraverseClass( cls, depth=1)

    HtmlFormatter.TraverseModule( depth=1)

    HtmlFormatter.Directory()

    HtmlFormatter.ErrorReport( dict)

    HtmlFormatter.ModuleError( module)

    HtmlFormatter.ModuleHeader( module)

    HtmlFormatter.ModuleFooter( module)

    HtmlFormatter.ClassMethodHeader()

    HtmlFormatter.ClassMethodFooter()

    HtmlFormatter.ClassSectionHeader( depth)

    HtmlFormatter.NoClassesPresent( depth=1)

    HtmlFormatter.ClassSectionFooter( depth)

    HtmlFormatter.FunctionSectionHeader( depth)

    HtmlFormatter.NoFunctionsPresent( depth=1)

    HtmlFormatter.FunctionSectionFooter( depth)

    HtmlFormatter.ClassHeader( cls)

    HtmlFormatter.ClassFooter( cls)

    HtmlFormatter.formatModule( module, depth=1)

    HtmlFormatter.formatClass( cls, depth)

    HtmlFormatter.ClassPropertiesHeader()

    HtmlFormatter.ClassPropertiesFooter()

    HtmlFormatter.formatProperty( property, depth)

    HtmlFormatter.formatFunction( function, depth, line=False, method=False)

TextFormatter Class

  • ||

    <<style='border:none;'>formatter.TextFormatter( absfilename, options=None)|| Derived From :

DataWalker||

  • Generates Text format for a single module

    absfile - the file name for the module
    options : opttions passed by the command line

Methods

  • TextFormatter.TraverseProperty( prop, depth=1, line=False, method=False)

    TextFormatter.TraverseFunction( func, depth=1, line=False, method=False)

    TextFormatter.TraverseClass( cls, depth=1)

    TextFormatter.TraverseModule( depth=1)

    TextFormatter.ModuleHeader( module)

Any header before the module starts

  • TextFormatter.ModuleFooter( module)

Processing once the end of the Module is reached.

  • TextFormatter.ClassHeader( dict)

    TextFormatter.ClassFooter( dict)

    TextFormatter.NoClassesPresent()

    TextFormatter.NoFunctionsPresent()

    TextFormatter.ClassSectionHeader( depth)

    TextFormatter.FunctionSectionHeader( depth)

    TextFormatter.FunctionSectionFooter( depth)

    TextFormatter.formatModule( module, depth=1)

    TextFormatter.formatClass( cls, depth)

    TextFormatter.formatFunction( function, depth, line=False, method=False)

WikiFormatter Class

  • ||

    <<style='border:none;'>formatter.WikiFormatter( module='', directory='', error='', options=None, autoclose=True, OutputStream='stdout')|| Derived From :

DataWalker||

  • Format the data as a html page

    OutputStream : Must be a fileType object - for instance an open file or a StringIO
    module : the absolute filename of the module to be displayed
    directory : the absolute path of the directory to be displayed
    error : A dictionary with details of the error to be displayed
    options : The options namescpace created from parse-arg
    autoclose : Whether the formatter should automatically close the file when finished.
    Where the OutputStream is StringIO this will probably need to be false.

    Currently - does not need to support the directoy or error formats - may support directory/Package in future.

Methods

  • WikiFormatter.TraverseProperty( prop, depth=1, line=False, method=False)

    WikiFormatter.TraverseFunction( func, depth=1, line=False, method=False)

    WikiFormatter.TraverseClass( cls, depth=1)

    WikiFormatter.TraverseModule( depth=1)

    WikiFormatter.Directory()

Not supported by a wiki page as yet

  • WikiFormatter.ErrorReport( dict)

Definitely not needed by a wiki

  • WikiFormatter.ModuleError( module)

Not needed by a wiki

  • WikiFormatter.ModuleHeader( module)

    WikiFormatter.ModuleFooter( module)

    WikiFormatter.ClassMethodHeader()

    WikiFormatter.ClassSectionHeader( depth)

    WikiFormatter.NoClassesPresent( depth=1)

    WikiFormatter.FunctionSectionHeader( depth)

    WikiFormatter.NoFunctionsPresent( depth=1)

    WikiFormatter.FunctionSectionFooter( depth)

    WikiFormatter.ClassHeader( cls)

    WikiFormatter.ClassFooter( cls)

    WikiFormatter.formatModule( module, depth=1)

    WikiFormatter.formatClass( cls, depth)

    WikiFormatter.ClassPropertiesHeader()

    WikiFormatter.formatProperty( property, depth)

    WikiFormatter.formatFunction( function, depth, line=False, method=False)

pager Class

  • <<style='border:none;'>formatter.pager()

    • pager class Encapsulates all the good stuff we need in a pager - Used by the Text formatter class only

Methods

  • pager.page( text)

Passes the text to the appropriate pager

  • The first time this is called, determine what kind of pager to use.

  • pager.bold( text)

Format a string in bold by overstriking.