[Epydoc-commits] SF.net SVN: epydoc: [1307] trunk/epydoc/src/epydoc/docwriter/html.py
Brought to you by:
edloper
From: <ed...@us...> - 2006-08-23 15:39:01
|
Revision: 1307 Author: edloper Date: 2006-08-23 08:38:56 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/epydoc/?rev=1307&view=rev Log Message: ----------- - Fixed 'failed identifier crossreference' detection. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2006-08-23 15:29:41 UTC (rev 1306) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2006-08-23 15:38:56 UTC (rev 1307) @@ -9,6 +9,8 @@ """ The HTML output generator for epydoc. The main interface provided by this module is the L{HTMLWriter} class. + +@todo: Add a cache to L{HTMLWriter.url()}? """ __docformat__ = 'epytext en' @@ -696,7 +698,7 @@ #//////////////////////////////////////////////////////////// def write_sourcecode(self, out, doc, name_to_docs): - t0 = time.time() + #t0 = time.time() filename = doc.filename name = str(doc.canonical_name) @@ -3113,22 +3115,20 @@ # Translate it into HTML. if doc is None: + self._failed_xref(identifier) return '<code class="link">%s</code>' % label else: return self.htmlwriter.href(doc, label, 'link') # [xx] Should this be added to the DocstringLinker interface??? + # Currently, this is *only* used by dotgraph. def url_for(self, identifier): if isinstance(identifier, (basestring, DottedName)): doc = self.docindex.find(identifier, self.container) if doc: return self.htmlwriter.url(doc) else: - # [xx] ignore if it's inside an import?? - # Record that we failed to find it. - failed_xrefs = self.htmlwriter._failed_xrefs - context = self.container.canonical_name - failed_xrefs.setdefault(identifier,{})[context] = 1 + return None elif isinstance(identifier, APIDoc): return self.htmlwriter.url(identifier) @@ -3137,3 +3137,9 @@ else: raise TypeError('Expected string or APIDoc') + def _failed_xref(self, identifier): + """Add an identifier to the htmlwriter's failed crossreference + list.""" + failed_xrefs = self.htmlwriter._failed_xrefs + context = self.container.canonical_name + failed_xrefs.setdefault(identifier,{})[context] = 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |