def _writetypesdoc(doc, thing, forceload=<NUM_LIT:0>):
try:<EOL><INDENT>object, name = pydoc.resolve(thing, forceload)<EOL>name = os.path.join(doc, name + '<STR_LIT>')<EOL><DEDENT>except (ImportError, pydoc.ErrorDuringImport) as value:<EOL><INDENT>log.debug(str(value))<EOL>return<EOL><DEDENT>cdict = {}<EOL>fdict = {}<EOL>elements_dict = {}<EOL>types_dict = {}<EOL>for kname,klass in inspect.getmembers(thing, inspect.isclass):<EOL><INDENT>if thing is not inspect.getmodule(klass):<EOL><INDENT>continue<EOL><DEDENT>cdict[kname] = inspect.getmembers(klass, inspect.isclass)<EOL>for iname,iklass in cdict[kname]:<EOL><INDENT>key = (kname,iname)<EOL>fdict[key] = _writedoc(doc, iklass)<EOL>if issubclass(iklass, ElementDeclaration):<EOL><INDENT>try:<EOL><INDENT>typecode = iklass()<EOL><DEDENT>except (AttributeError,RuntimeError) as ex:<EOL><INDENT>elements_dict[iname] = _writebrokedoc(doc, ex, iname)<EOL>continue<EOL><DEDENT>elements_dict[iname] = None<EOL>if typecode.pyclass is not None:                        <EOL><INDENT>elements_dict[iname] = _writedoc(doc, typecode.pyclass)<EOL><DEDENT>continue<EOL><DEDENT>if issubclass(iklass, TypeDefinition):<EOL><INDENT>try:<EOL><INDENT>typecode = iklass(None)<EOL><DEDENT>except (AttributeError,RuntimeError) as ex:<EOL><INDENT>types_dict[iname] = _writebrokedoc(doc, ex, iname)<EOL>continue<EOL><DEDENT>types_dict[iname] = None<EOL>if typecode.pyclass is not None:<EOL><INDENT>types_dict[iname] = _writedoc(doc, typecode.pyclass)<EOL><DEDENT>continue<EOL><DEDENT><DEDENT><DEDENT>def strongarm(self, object, name=None, mod=None, funcs={}, classes={}, *ignored):<EOL><INDENT>"""<STR_LIT>"""<EOL>realname = object.__name__<EOL>name = name or realname<EOL>bases = object.__bases__<EOL>object, name = pydoc.resolve(object, forceload)<EOL>contents = []<EOL>push = contents.append<EOL>if name == realname:<EOL><INDENT>title = '<STR_LIT>' % (<EOL>name, realname)<EOL><DEDENT>else:   <EOL><INDENT>title = '<STR_LIT>' % (<EOL>name, name, realname)<EOL><DEDENT>mdict = {}<EOL>if bases:<EOL><INDENT>parents = []<EOL>for base in bases:<EOL><INDENT>parents.append(self.classlink(base, object.__module__))<EOL><DEDENT>title = title + '<STR_LIT>' % pydoc.join(parents, '<STR_LIT:U+002CU+0020>')<EOL><DEDENT>doc = self.markup(pydoc.getdoc(object), self.preformat, funcs, classes, mdict)<EOL>doc = doc and '<STR_LIT>' % doc<EOL>for iname,iclass in cdict[name]:<EOL><INDENT>fname = fdict[(name,iname)]<EOL>if iname in elements_dict:<EOL><INDENT>push('<STR_LIT>'%(fname,iname))<EOL>pyclass = elements_dict[iname]<EOL>if pyclass is not None:<EOL><INDENT>push('<STR_LIT>')<EOL>push('<STR_LIT>'%elements_dict[iname])<EOL>push('<STR_LIT>')<EOL><DEDENT><DEDENT>elif iname in types_dict:<EOL><INDENT>push('<STR_LIT>' %(fname,iname))<EOL>pyclass = types_dict[iname]<EOL>if pyclass is not None:<EOL><INDENT>push('<STR_LIT>')<EOL>push('<STR_LIT>'%types_dict[iname])<EOL>push('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>push('<STR_LIT>' %(fname,iname))<EOL><DEDENT><DEDENT>contents = '<STR_LIT>'.join(contents)<EOL>return self.section(title, '<STR_LIT>', '<STR_LIT>', contents, <NUM_LIT:3>, doc) <EOL><DEDENT>doclass = pydoc.HTMLDoc.docclass<EOL>pydoc.HTMLDoc.docclass = strongarm<EOL>try:<EOL><INDENT>page = pydoc.html.page(pydoc.describe(object), pydoc.html.document(object, name))<EOL>file = open(name, '<STR_LIT:w>')<EOL>file.write(page)<EOL>file.close()<EOL><DEDENT>except (ImportError, pydoc.ErrorDuringImport) as value:<EOL><INDENT>log.debug(str(value))<EOL><DEDENT>pydoc.HTMLDoc.docclass = doclass<EOL>
Write HTML documentation to a file in the current directory.