Base abstract class for formatters which can output XML.
Base Classes
|
|
happydoclib.formatter.fileformatterbase.FileBasedFormatter
|
Methods
|
|
|
|
__init__
|
__init__ (
self,
docset,
encoding='iso-8859-1',
index_file_name='index',
file_name_ext='xml',
**conf,
)
Initialize the XMLStructFormatter.
Arguments
-
docset
- the DocSet instance containing global cross-reference
information
-
encoding
- documentation file encoding (default
iso-8859-1 )
-
index_file_name
- package index filename (default
index )
-
file_name_ext
- documentation filename extension (default
xml )
-
**conf
- additional, optional configuration values
|
|
classIndex
|
classIndex (
self,
info,
output,
)
Method invoked by docset to process class index item.
Arguments
-
info
- class info object
-
output
- output file object
|
|
comment
|
comment (
self,
text,
output,
)
Outputs comment to the output file.
Arguments
-
text
- comment text
-
output
- output file object
|
|
decIndent
|
decIndent ( self )
|
|
emptyTag
|
emptyTag (
self,
name,
output,
attrs={},
)
Outputs empty tag.
Arguments
-
name
- tag name
-
output
- output file object
-
attrs
- tag attributes; every item { key:
value } is rendered as key="value"
|
|
endTag
|
endTag (
self,
name,
output,
)
Outputs closing tag. Method tag should be used to open the tag.
Arguments
-
name
- tag name
-
output
- output file object
|
|
getAttrs
|
getAttrs ( self, attrs )
Converts Python dictionary into XML attributes string.
For example {
'attr1': val1 ,
'attr2': val2 ,
'attr3': val3 ,
}
is converted to the following string
attr1="val1" attr2="val2" attr3="val3"
Arguments
-
attrs
- dictionary with XML attributes
Returns attributes string.
|
|
getEncoding
|
getEncoding ( self )
Returns XML file encoding. File encoding can be specified with
encoding formatter parameter.
|
|
getFileNameExtension
|
getFileNameExtension ( self )
Returns filename extension. It can be specified with file_name_ext
formatter parameter.
|
|
getIndent
|
getIndent ( self )
|
|
getIndexFileName
|
getIndexFileName ( self )
Returns package index file name. This file should contain
all documentation files in current directory. Default filename
extension is appended to the end of the name. The base name
can be specified with index_name formatter parameter.
|
|
incIndent
|
incIndent ( self )
|
|
moduleIndex
|
moduleIndex (
self,
info,
output,
)
Method invoked by docset to process module index item.
Arguments
-
info
- module info object
-
output
- output file object
|
|
packageIndex
|
packageIndex (
self,
info,
output,
)
Method invoked by docset to process package index item.
Arguments
-
info
- package info object
-
output
- output file object
|
|
processClass
|
processClass (
self,
info,
output,
stage,
)
Method invoked by docset, when class is being processed.
-
info
- class info object
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processClassBase
|
processClassBase (
self,
info,
cinfo,
output,
stage,
)
Method invoked by docset, when inherited class info of derived class is being processed.
-
info
- base class info object
-
cinfo
- derived class
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processDocString
|
processDocString (
self,
info,
output,
stage,
)
Method invoked by docset, when docstring is being processed.
Arguments
-
info
- docstring owner (module, class, function, etc.) info object
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processException
|
processException (
self,
info,
output,
stage,
)
Method invoked by docset, when exception is being processed.
-
info
- exception info object or string with exception name
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processFunction
|
processFunction (
self,
info,
output,
stage,
)
Method invoked by docset, when function or class method is being processed.
-
info
- function or class method info object
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processImport
|
processImport (
self,
iinfo,
minfo,
output,
stage,
)
Method invoked by docset, when import statement is being processed.
Arguments
-
iinfo
- imported module info object
-
minfo
- info object of module, where import statement is declared
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processImportSymbol
|
processImportSymbol (
self,
info,
output,
stage,
)
Method invoked by docset, when import symbol is being processed.
-
info
- info object of imported symbol or string with symbol name
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processModule
|
processModule (
self,
info,
output,
stage,
)
Method invoked by docset, when module is being processed.
Arguments
-
info
- module info object
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processPackage
|
processPackage (
self,
info,
output,
stage,
)
Method invoked by docset, when package is being processed.
Arguments
-
info
- package info object
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processParam
|
processParam (
self,
info,
output,
stage,
)
Method invoked by docset, when function or class method parameter is being processed.
Arguments
-
info
- function or class method parameter info object
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
|
|
processRoot
|
processRoot (
self,
output,
stage,
rtype,
)
Method invoked by docset, when new file is opened. This method
can be used to output XML declaration, DTD, etc. Arguments
-
output
- output file object
-
stage
- processing stage (one of: PRE, START, END, POST values)
-
rtype
- file type (index, module or class file)
|
|
tag
|
tag (
self,
name,
output,
attrs={},
)
This method outputs opening tag with attributes. Method endTag should
be used to close the tag. Arguments
-
name
- tag name
-
output
- output file object
-
attrs
- tag attributes; every item { key:
value } is rendered as key="value"
|
|
writeTaggedText
|
writeTaggedText (
self,
tag,
text,
output,
)
Outputs text between opening and closing XML tags. For example
self.writeTaggedText(tag , text , output)
outputs
<tag>text</tag>
Arguments
-
tag
- tag name
-
text
- tagged text
-
output
- output file object
|
|
writeText
|
writeText (
self,
text,
output,
textFormat=None,
quote=1,
)
Outputs text to XML file.
Arguments
-
text
- text to output
-
output
- output file object
-
textFormat
- String identifying the format of
text so
the formatter can use a docstring converter to convert the
body of text to the appropriate output format.
-
quote=1
- Boolean option to control whether the text
should be quoted to escape special characters.
|
|