[Epydoc-commits] SF.net SVN: epydoc: [1804] trunk/epydoc/src/epydoc/docwriter/html.py
Brought to you by:
edloper
From: <ed...@us...> - 2008-02-27 19:54:45
|
Revision: 1804 http://epydoc.svn.sourceforge.net/epydoc/?rev=1804&view=rev Author: edloper Date: 2008-02-27 11:54:39 -0800 (Wed, 27 Feb 2008) Log Message: ----------- - Fixed bug that causes crash when we can't determine the canonical name for a metaclass. - Fixed bug in callgraph rendering. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-27 00:32:35 UTC (rev 1803) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-27 19:54:39 UTC (rev 1804) @@ -848,7 +848,7 @@ # Write the name of the class we're describing. if (doc.metaclass is not UNKNOWN and - doc.metaclass.canonical_name is not UNKNOWN and + doc.metaclass.canonical_name not in (None, UNKNOWN) and doc.metaclass.canonical_name != 'type'): typ = self.href(doc.metaclass, doc.metaclass.canonical_name[-1]) elif doc.is_type(): typ = 'Type' @@ -1667,28 +1667,25 @@ if isinstance(callgraph, basestring): uid = callgraph - rv = self._callgraph_cache.get(callgraph, "") - + graph_html = self._callgraph_cache.get(callgraph, "") + elif callgraph.uid in self._callgraph_cache: + uid = callgraph.uid + graph_html = self._callgraph_cache.get(callgraph, "") else: uid = callgraph.uid graph_html = self.render_graph(callgraph) - if graph_html == '': - rv = "" - else: - rv = ('<div style="display:none" id="%%s-div"><center>\n' - '<table border="0" cellpadding="0" cellspacing="0">\n' - ' <tr><td>%s</td></tr>\n' - ' <tr><th>Call Graph</th></tr>\n' - '</table><br />\n</center></div>\n' % graph_html) + self._callgraph_cache[uid] = graph_html - # Store in the cache the complete HTML chunk without the - # div id, which may be made unambiguous by the token - self._callgraph_cache[uid] = rv + if graph_html: + return ('<div style="display:none" id="%s-div"><center>\n' + '<table border="0" cellpadding="0" cellspacing="0">\n' + ' <tr><td>%s</td></tr>\n' + ' <tr><th>Call Graph</th></tr>\n' + '</table><br />\n</center></div>\n' % + (uid+token, graph_html)) + else: + return '' - # Mangle with the graph - if rv: rv = rv % (uid + token) - return rv - def callgraph_link(self, callgraph, token=""): """Render the HTML chunk of a callgraph link. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |