htmldoc 0.2 2003/05/03

Create an HTML summary of a python module.

Unlike pydoc's output, this is "nice" CSS HTML4 code.
Written by Michael Urman (mu on irc.freenode.net)
Uses Modules
os sys types
Classes
Attribute Object
class Arg(Var)
Represent arguments to a function
Methods
__init__(self, obj, name=None) from Object
__str__(self) from Object
doc(self) from Object
name(self) from Object
val(self) from Var
class Attribute
Handle CSS attributes somewhat python style
Methods
__init__(self, sel, bg=None, fg=None, **kw)
__repr__(self)
__str__(self)
class Class(Object)
Represent a class
Methods
__init__(self, obj, name=None) from Object
__str__(self) from Object
bases(self)
bases(self) -> list of Class objects

Return a list generator of Class self's base classes
const(self)
const(self) -> Method

Return the Method corresponding to __init__()
doc(self) from Object
methods(self)
methods(self) -> list of Method objects

Return a list generator of methods in the class
name(self) from Object
properties(self)
properties(self) -> list of property objects

Return a list generator of properties of the class
subclasses(self)
vars(self)
vars(self) -> list of Var objects

Return a list generator of class variables
class DArg(Arg)
Represent arguments with a default value
Methods
__init__(self, obj, name=None, default=None)
__init__(self, obj, name=None, default=None) -> DArg

Initialize a DArg with default value
__str__(self)
default(self)
default(self) -> str

Return a stringified version of the default value
doc(self) from Object
name(self) from Object
val(self) from Var
class Function(Object)
Represent a function
Methods
__init__(self, obj, name=None) from Object
__str__(self)
args(self)
args(self) -> list of Arg (and Arg derived) objects

Return a list generator of function arguments
doc(self) from Object
getcode(self)
getdefaults(self)
name(self) from Object
class InheritedMethod(Method)
Represent a method inherited from a parent class
Methods
__init__(self, obj, name=None, class_=None, from_=None)
__init__(self, obj, name=None, class_=None, from_=None) -> InheritedMethod

Initialize an InheritedMethod with class from which it inherits
__str__(self) from Function
args(self) from Function
cls(self) from Method
doc(self) from Object
getcode(self) from Method
getdefaults(self) from Method
inherited(self)
inherited(self) -> str

Return the name of the class from which the method is inherited
name(self) from Object
class KWArg(Arg)
Represent an argument grabbing dictionary
Methods
__init__(self, obj, name=None) from Object
__str__(self)
doc(self) from Object
name(self) from Object
val(self) from Var
class Method(Function)
Represent a method
Methods
__init__(self, obj, name=None, class_=None)
__init__(self, obj, name=None, class_=None) -> Method

Initialize an Method with its class
__str__(self) from Function
args(self) from Function
cls(self)
cls(self) -> Clas

Return this method's Class
doc(self) from Object
getcode(self)
getdefaults(self)
name(self) from Object
class MethodRef(Method)
Represent some sort of method reference, such as used in a property
Methods
__init__(self, obj, name=None, class_=None) from Method
__str__(self)
args(self) from Function
cls(self) from Method
doc(self) from Object
getcode(self) from Method
getdefaults(self) from Method
name(self) from Object
class Module(Object)
Represent a module
Methods
__init__(self, obj, name=None) from Object
__str__(self) from Object
author(self)
Return module.__author__ or None
baseclasses(self)
baseclasses(self) -> list of Class objects

Return a list generator of base classes; classes which have no parent classes in the module
classes(self)
classes(self) -> list of Class objects

Return a list generator of all classes in the module
date(self)
Return module.__date__ or None
doc(self) from Object
functions(self)
functions(self) -> list of Function objects

Return a list generator of all module level functions
modules(self)
modules(self) -> list of Module objects

Return a list of modules defined (imported into) the module
name(self) from Object
vars(self)
vars(self) -> list of Var objects

Return a list generator of module level variables
version(self)
Return module.__version__ or None
class Object
Base class for the Object Hierarchy
Methods
__init__(self, obj, name=None)
__init_(self, obj,name=None) -> Object

Initialize an Object with optional parameter name
__str__(self)
__str__(self) -> str

Represent an object with its name (by default)
doc(self)
doc(self) -> docstring

Return the object's docstring, or None if not available
name(self)
name(self) -> str

Return the object's name, either as specified, or stored
class Property(Object)
Represent properties
Methods
__init__(self, obj, name=None) from Object
__str__(self) from Object
doc(self) from Object
name(self) from Object
val(self)
class VArg(Arg)
Represent an argument grabbing list
Methods
__init__(self, obj, name=None) from Object
__str__(self)
doc(self) from Object
name(self) from Object
val(self) from Var
class Var(Object)
Represent variables
Methods
__init__(self, obj, name=None) from Object
__str__(self) from Object
doc(self) from Object
name(self) from Object
val(self)
Functions
esc genlen main writecss writefuncs writehtml writetext writevars
esc(s, nl=br)
escape a string for html safety. nl can be one of the following:

'br': use <br /> tags to replace \n

'p': use </p><p> tags to replace \n and wrap in a <p>...</p>

'rbr': usr <br /><br /> tags to replace \n\s*\n

'rp: use </p><p> tags to replace \n\s*\n and wrap in a <p>...</p>
genlen(gen)
genlen(gen) -> bool

Return whether generator has any elements by testing for StopIteration
main()
writecss(dst)
writefuncs(out, title, indent=0, css=('functions', 'function'), *funcs)
writehtml(module, dst, css, title=Syntax Hilight)
writetext(module, dst)
writevars(out, title, indent=0, css=('data', 'datum'), *vars)
Global Data
attributes = [<Attribute sel='body'>, <Attribute sel='a'>, <Attribute sel='a:hover'>, <Attribute sel='.doc'>, <Attribute sel='.list'>, <Attribute sel='.head > .info'>, <Attribute sel='.module > .head'>, <Attribute sel='.module > .doc'>, <Attribute sel='.module > .info'>, <Attribute sel='.usemodules'>, <Attribute sel='.usemodules > .head'>, <Attribute sel='.classes'>, <Attribute sel='.classtree'>, <Attribute sel='.subclasstree'>, <Attribute sel='a.tree'>, <Attribute sel='.classtree > .tree:before'>, <Attribute sel='.subclasstree > .tree:before'>, <Attribute sel='.classes > .head'>, <Attribute sel='.class'>, <Attribute sel='.class > .head'>, <Attribute sel='.class > .doc'>, <Attribute sel='.vars'>, <Attribute sel='.vars > .head'>, <Attribute sel='.varinfo > .var'>, <Attribute sel='.varinfo > .val'>, <Attribute sel='.methods'>, <Attribute sel='.methods > .head'>, <Attribute sel='.method, .function'>, <Attribute sel='.method > .head + .doc, .function > .head + .doc'>, <Attribute sel='.method > .doc, .function > .doc'>, <Attribute sel='.funcname'>, <Attribute sel='.argname'>, <Attribute sel='.argdef'>, <Attribute sel='.functions'>, <Attribute sel='.functions > .head'>, <Attribute sel='.data'>, <Attribute sel='.data > .head'>, <Attribute sel='.datum'>, <Attribute sel='.datum > .var'>, <Attribute sel='.datum > .val'>]
generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 4096)
indentstr = ' '