[Epydoc-commits] SF.net SVN: epydoc: [1308] trunk/epydoc/src/epydoc/apidoc.py
Brought to you by:
edloper
From: <ed...@us...> - 2006-08-23 15:47:15
|
Revision: 1308 Author: edloper Date: 2006-08-23 08:47:09 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/epydoc/?rev=1308&view=rev Log Message: ----------- - Changed DocIndex.find() to return the VariableDoc instead of the ValueDoc for variables with GenericValueDoc values. Modified Paths: -------------- trunk/epydoc/src/epydoc/apidoc.py Modified: trunk/epydoc/src/epydoc/apidoc.py =================================================================== --- trunk/epydoc/src/epydoc/apidoc.py 2006-08-23 15:38:56 UTC (rev 1307) +++ trunk/epydoc/src/epydoc/apidoc.py 2006-08-23 15:47:09 UTC (rev 1308) @@ -29,6 +29,8 @@ because several variables can contain the same value: each variable should be described by a separate C{VariableDoc}; but we only need one C{ValueDoc}, since they share a single value. + +@todo: Add a cache to canonical name lookup? """ __docformat__ = 'epytext en' @@ -1621,8 +1623,8 @@ def find(self, name, context): """ - Look for a C{ValueDoc} named C{name}, relative to C{context}. - Return the C{ValueDoc} if one is found; otherwise, return + Look for an C{APIDoc} named C{name}, relative to C{context}. + Return the C{APIDoc} if one is found; otherwise, return C{None}. C{find} looks in the following places, in order: - Function parameters (if one matches, return C{None}) - All enclosing namespaces, from closest to furthest. @@ -1632,7 +1634,7 @@ - Parameter attributes @type name: C{str} or L{DottedName} - @type context: L{ValueDoc} + @type context: L{APIDoc} """ if isinstance(name, basestring): name = re.sub(r'\(.*\)$', '', name.strip()) @@ -1653,8 +1655,11 @@ for i in range(len(container_name), -1, -1): relative_name = container_name[:i]+name # Is `name` the absolute name of a documented value? + # (excepting GenericValueDoc values.) val_doc = self.get_valdoc(relative_name) - if val_doc is not None: return val_doc + if (val_doc is not None and + not isinstance(val_doc, GenericValueDoc)): + return val_doc # Is `name` the absolute name of a documented variable? var_doc = self.get_vardoc(relative_name) if var_doc is not None: return var_doc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |