[Epydoc-commits] SF.net SVN: epydoc: [1342] trunk/epydoc/src/epydoc/docwriter/html.py
Brought to you by:
edloper
|
From: <ed...@us...> - 2006-09-02 00:54:37
|
Revision: 1342
http://svn.sourceforge.net/epydoc/?rev=1342&view=rev
Author: edloper
Date: 2006-09-01 17:54:33 -0700 (Fri, 01 Sep 2006)
Log Message:
-----------
- Added a cache to HTMLWriter.url()
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-09-02 00:53:39 UTC (rev 1341)
+++ trunk/epydoc/src/epydoc/docwriter/html.py 2006-09-02 00:54:33 UTC (rev 1342)
@@ -886,8 +886,7 @@
the top-level list is a class with no (documented) bases; and
under each class is listed all of its subclasses. Note that
in the case of multiple inheritance, a class may appear
- multiple times. This is used by L{write_trees} to write
- the class hierarchy.
+ multiple times.
@todo: For multiple inheritance, don't repeat subclasses the
second time a class is mentioned; instead, link to the
@@ -2906,11 +2905,23 @@
''')
# \------------------------------------------------------------/
+ _url_cache = {}
def url(self, obj):
"""
Return the URL for the given object, which can be a
C{VariableDoc}, a C{ValueDoc}, or a C{DottedName}.
"""
+ cached_url = self._url_cache.get(id(obj))
+ if cached_url is not None:
+ return cached_url
+ else:
+ url = self._url_cache[id(obj)] = self._url(obj)
+ return url
+
+ def _url(self, obj):
+ """
+ Internal helper for L{url}.
+ """
# Module: <canonical_name>-module.html
if isinstance(obj, ModuleDoc):
if obj not in self.module_set: return None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|