formatter

Differences between revisions 38 and 39
Revision 38 as of 2014-04-06 08:21:04
Size: 9490
Editor: host217-42-218-163
Comment:
Revision 39 as of 2014-04-06 08:21:49
Size: 9504
Editor: host217-42-218-163
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`formatterError`'''(```` msg````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',BaseException || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`formatterError`'''(```` msg````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',BaseException ||
Line 29: Line 29:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`InvalidDictionaryError`'''(```` msg````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#formatterError|formatterError]] || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`InvalidDictionaryError`'''(```` msg````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#formatterError|formatterError]] ||
Line 41: Line 41:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`DataWalker`'''(```` options=None````) ||<style="border:none;" text-align:right; tablewidth="75%"> || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`DataWalker`'''(```` options=None````) ||<style="border:none;" text-align:right; tablewidth="75%"> ||
Line 61: Line 61:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`HtmlFormatter`'''(```` module=`''`, directory=`''`, error=`''`, options=None, autoclose=True, OutputStream='stdout'````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#DataWalker|DataWalker]] || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`HtmlFormatter`'''(```` module=`''`, directory=`''`, error=`''`, options=None, autoclose=True, OutputStream='stdout'````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#DataWalker|DataWalker]] ||
Line 123: Line 123:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`TextFormatter`'''(```` absfilename, options=None````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#DataWalker|DataWalker]] || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`TextFormatter`'''(```` absfilename, options=None````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#DataWalker|DataWalker]] ||
Line 171: Line 171:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`WikiFormatter`'''(```` module=`''`, directory=`''`, error=`''`, options=None, autoclose=True, OutputStream='stdout'````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#DataWalker|DataWalker]] || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`WikiFormatter`'''(```` module=`''`, directory=`''`, error=`''`, options=None, autoclose=True, OutputStream='stdout'````) ||<style="border:none;" text-align:right; tablewidth="75%"> ''Derived From :'',[[#DataWalker|DataWalker]] ||
Line 233: Line 233:
||<style="border:none;" text-align:left; tablewidth="75%"> ''`formatter`''.'''`pager`'''(````````) ||<style="border:none;" text-align:right; tablewidth="75%"> || ||<style="border:none;" "text-align:left"; tablewidth="75%"> ''`formatter`''.'''`pager`'''(````````) ||<style="border:none;" text-align:right; tablewidth="75%"> ||

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

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.formatterError( msg)

Expected "=" to follow "text"

Derived From :,BaseException

Properties

  • formatterError.args Read Only

    formatterError.message Read Only

InvalidDictionaryError Class

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.InvalidDictionaryError( msg)

Expected "=" to follow "text"

Derived From :,formatterError

Properties

  • InvalidDictionaryError.args Read Only

    InvalidDictionaryError.message Read Only

DataWalker Class

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.DataWalker( options=None)

Expected "=" to follow "text"

  • 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

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.HtmlFormatter( module='', directory='', error='', options=None, autoclose=True, OutputStream='stdout')

Expected "=" to follow "text"

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

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.TextFormatter( absfilename, options=None)

Expected "=" to follow "text"

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

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.WikiFormatter( module='', directory='', error='', options=None, autoclose=True, OutputStream='stdout')

Expected "=" to follow "text"

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

Expected "=" to follow ""text-align:left""
Expected "=" to follow ""text-align:left""

formatter.pager()

Expected "=" to follow "text"

  • 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.

TimeWarp/formatter (last edited 2014-04-06 09:20:33 by host217-42-218-163)