[Epydoc-commits] SF.net SVN: epydoc: [1304] trunk/epydoc/src/epydoc/docwriter/html_colorize.py
Brought to you by:
edloper
From: <ed...@us...> - 2006-08-23 15:02:19
|
Revision: 1304 Author: edloper Date: 2006-08-23 08:01:24 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/epydoc/?rev=1304&view=rev Log Message: ----------- - Turned off GUESS_LINK_TARGETS flag in source code colorizer. - Optimized code that guesses link targets, to make it run faster. (Based on a patch provided by Daniel von Dincklage.) Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html_colorize.py Modified: trunk/epydoc/src/epydoc/docwriter/html_colorize.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html_colorize.py 2006-08-23 14:59:28 UTC (rev 1303) +++ trunk/epydoc/src/epydoc/docwriter/html_colorize.py 2006-08-23 15:01:24 UTC (rev 1304) @@ -598,7 +598,7 @@ #: If true, then try to guess which target is appropriate for #: linked names; if false, then always open a div asking the #: user which one they want. - GUESS_LINK_TARGETS = True + GUESS_LINK_TARGETS = False def __init__(self, module_filename, module_name, docindex=None, url_func=None, name_to_docs=None): @@ -938,15 +938,18 @@ if (self.GUESS_LINK_TARGETS and self.docindex is not None and self.url_func is not None): context = [n for n in self.context if n is not None] - container = DottedName(self.module_name, *context) - doc = self.docindex.get_vardoc(container+toktext) - if doc is not None: - url = self.url_func(doc) + container = self.docindex.get_vardoc( + DottedName(self.module_name, *context)) + if isinstance(container, NamespaceDoc): + doc = container.variables.get(toktext) + if doc is not None: + url = self.url_func(doc) + tooltip = str(doc.canonical_name) # Otherwise, check the name_to_docs index to see what # else this name might refer to. if (url is None and self.name_to_docs is not None and self.url_func is not None): - docs = self.name_to_docs.get(toktext, []) + docs = self.name_to_docs.get(toktext) if docs: tooltip='\n'.join([str(d.canonical_name) for d in docs]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |