def _writeclientdoc(doc, thing, forceload=0):
"""Write HTML documentation to a file in the current directory.
"""
docmodule = pydoc.HTMLDoc.docmodule
def strongarm(self, obj, name=None, mod=None, *ignored):
result = docmodule(self, obj, name, mod, *ignored)
# Grab all the aliases to pyclasses and create links.
nonmembers = []
push = nonmembers.append
for k,v in inspect.getmembers(obj, inspect.isclass):
if inspect.getmodule(v) is not obj and getattr(v,'typecode',None) is not None:
push('<a href="%s.html">%s</a>: pyclass alias<br/>' %(v.__name__,k))
result += self.bigsection('Aliases', '#ffffff', '#eeaa77', ''.join(nonmembers))
return result
pydoc.HTMLDoc.docmodule = strongarm
try:
obj, name = pydoc.resolve(thing, forceload)
page = pydoc.html.page(pydoc.describe(obj), pydoc.html.document(obj, name))
name = os.path.join(doc, name + '.html')
fd = open(name, 'w')
fd.write(page)
fd.close()
except (ImportError, pydoc.ErrorDuringImport), value:
log.debug(str(value))
pydoc.HTMLDoc.docmodule = docmodule