epydoc-commits Mailing List for Python API documentation generation tool (Page 7)
Brought to you by:
edloper
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(77) |
May
|
Jun
(6) |
Jul
(8) |
Aug
(91) |
Sep
(67) |
Oct
(4) |
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(17) |
Feb
(135) |
Mar
(25) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(62) |
Oct
(1) |
Nov
(3) |
Dec
|
2008 |
Jan
(40) |
Feb
(102) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dva...@us...> - 2007-11-07 15:23:47
|
Revision: 1662 http://epydoc.svn.sourceforge.net/epydoc/?rev=1662&view=rev Author: dvarrazzo Date: 2007-11-07 07:23:41 -0800 (Wed, 07 Nov 2007) Log Message: ----------- - Don't crash with a group containing only submodules which are not variables (because they are contained in but not imported by a package). Modified Paths: -------------- trunk/epydoc/src/epydoc/apidoc.py Modified: trunk/epydoc/src/epydoc/apidoc.py =================================================================== --- trunk/epydoc/src/epydoc/apidoc.py 2007-11-07 12:59:34 UTC (rev 1661) +++ trunk/epydoc/src/epydoc/apidoc.py 2007-11-07 15:23:41 UTC (rev 1662) @@ -1201,7 +1201,7 @@ if group is None: var_list = self.sorted_variables else: - var_list = self.variable_groups[group] + var_list = self.variable_groups.get(group, self.sorted_variables) # Public/private filter (Count UNKNOWN as public) if public is True: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-11-07 12:59:35
|
Revision: 1661 http://epydoc.svn.sourceforge.net/epydoc/?rev=1661&view=rev Author: dvarrazzo Date: 2007-11-07 04:59:34 -0800 (Wed, 07 Nov 2007) Log Message: ----------- - The importgraph directive takes a packages list argument as advertised by docs. Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/restructuredtext.py Modified: trunk/epydoc/src/epydoc/markup/restructuredtext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-10-20 16:48:44 UTC (rev 1660) +++ trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-11-07 12:59:34 UTC (rev 1661) @@ -868,13 +868,20 @@ def importgraph_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): return [ dotgraph(_construct_importgraph, arguments, options) ] +importgraph_directive.arguments = (0, 1, True) importgraph_directive.options = {'dir': _dir_option} importgraph_directive.content = False directives.register_directive('importgraph', importgraph_directive) def _construct_importgraph(docindex, context, linker, arguments, options): """Graph generator for L{importgraph_directive}""" - modules = [d for d in docindex.root if isinstance(d, ModuleDoc)] + if len(arguments) == 1: + modules = [ docindex.find(name, context) + for name in arguments[0].replace(',',' ').split() ] + modules = [d for d in modules if isinstance(d, ModuleDoc)] + else: + modules = [d for d in docindex.root if isinstance(d, ModuleDoc)] + return import_graph(modules, docindex, linker, context, **options) def callgraph_directive(name, arguments, options, content, lineno, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-10-20 16:48:46
|
Revision: 1660 http://epydoc.svn.sourceforge.net/epydoc/?rev=1660&view=rev Author: dvarrazzo Date: 2007-10-20 09:48:44 -0700 (Sat, 20 Oct 2007) Log Message: ----------- - Methods and variables order consistent with other generated docs. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-09-27 10:17:07 UTC (rev 1659) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-10-20 16:48:44 UTC (rev 1660) @@ -467,7 +467,8 @@ show_private = options.get('show_private_vars', False) show_magic = options.get('show_magic_vars', True) show_inherited = options.get('show_inherited_vars', False) - for name, var in class_doc.variables.iteritems(): + for var in class_doc.sorted_variables: + name = var.canonical_name[-1] if ((not show_private and var.is_public == False) or (not show_magic and re.match('__\w+__$', name)) or (not show_inherited and var.container != class_doc)): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-09-27 10:17:11
|
Revision: 1659 http://epydoc.svn.sourceforge.net/epydoc/?rev=1659&view=rev Author: dvarrazzo Date: 2007-09-27 03:17:07 -0700 (Thu, 27 Sep 2007) Log Message: ----------- - Fixed missing close tag. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-26 19:25:35 UTC (rev 1658) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-27 10:17:07 UTC (rev 1659) @@ -2326,7 +2326,7 @@ </td><td align="right" valign="top" >$self.pysrc_link(func_doc)$ $self.callgraph_link(callgraph)$</td> - </table> + </tr></table> $self.render_callgraph(callgraph)$ $descr$ <dl class="fields"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 19:25:37
|
Revision: 1658 http://epydoc.svn.sourceforge.net/epydoc/?rev=1658&view=rev Author: edloper Date: 2007-09-26 12:25:35 -0700 (Wed, 26 Sep 2007) Log Message: ----------- - Fixed html typo Modified Paths: -------------- trunk/epydoc/doc/faq.html Modified: trunk/epydoc/doc/faq.html =================================================================== --- trunk/epydoc/doc/faq.html 2007-09-26 19:23:23 UTC (rev 1657) +++ trunk/epydoc/doc/faq.html 2007-09-26 19:25:35 UTC (rev 1658) @@ -366,7 +366,6 @@ >epydoc.cli-module.html#HELP_TOPICS</a>></tt>. The redirect page can be used for any object documented by epydoc, including modules, classes, functions, varaibles, properties, etc. </p></dd> -</dl> <!-- QUESTION --><a name="redundant-details" /> <dt><p><b>Q:</b> Why are some values listed in the details This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 19:23:30
|
Revision: 1657 http://epydoc.svn.sourceforge.net/epydoc/?rev=1657&view=rev Author: edloper Date: 2007-09-26 12:23:23 -0700 (Wed, 26 Sep 2007) Log Message: ----------- - Fixed html typo Modified Paths: -------------- trunk/epydoc/doc/faq.html Modified: trunk/epydoc/doc/faq.html =================================================================== --- trunk/epydoc/doc/faq.html 2007-09-26 19:03:00 UTC (rev 1656) +++ trunk/epydoc/doc/faq.html 2007-09-26 19:23:23 UTC (rev 1657) @@ -117,8 +117,6 @@ href="fields.html#newfield">fields</a> for more information. </p></dd> -</dl> - <!-- QUESTION --><a name="epytext_fail" /> <dt><p><b>Q:</b> Why does epydoc render one of my epytext-formatted docstrings as plaintext? </p></dt> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 19:03:02
|
Revision: 1656 http://epydoc.svn.sourceforge.net/epydoc/?rev=1656&view=rev Author: edloper Date: 2007-09-26 12:03:00 -0700 (Wed, 26 Sep 2007) Log Message: ----------- - If the parser & introspector disagree about submodules, then issue a warning, and merge the two lists. It's still not clear *why* this might happen, but I suspect it might be the cause of a bug I'm investigating. Modified Paths: -------------- trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-09-26 18:44:11 UTC (rev 1655) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-09-26 19:03:00 UTC (rev 1656) @@ -1010,6 +1010,16 @@ def merge_docs_extracted_by(v1, v2, precedence, cyclecheck, path): return 'both' +def merge_submodules(v1, v2, precedence, cyclecheck, path): + n1 = sorted([m.canonical_name for m in v1]) + n2 = sorted([m.canonical_name for m in v2]) + if (n1 != n2) and (n2 != []): + log.warning('Introspector & parser disagree about submodules ' + 'for %s: %s vs %s' % (path, n1, n2)) + return v1 + [m for m in v2 if m.canonical_name not in n1] + + return v1 + register_attribute_mergefunc('variables', merge_variables) register_attribute_mergefunc('value', merge_value) register_attribute_mergefunc('overrides', merge_overrides) @@ -1021,6 +1031,7 @@ register_attribute_mergefunc('posarg_defaults', merge_posarg_defaults) register_attribute_mergefunc('docstring', merge_docstring) register_attribute_mergefunc('docs_extracted_by', merge_docs_extracted_by) +register_attribute_mergefunc('submodules', merge_submodules) ###################################################################### ## Import Linking This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 18:44:20
|
Revision: 1655 http://epydoc.svn.sourceforge.net/epydoc/?rev=1655&view=rev Author: edloper Date: 2007-09-26 11:44:11 -0700 (Wed, 26 Sep 2007) Log Message: ----------- - Made warning about bases that don't appear to be classes a little more explicit. Modified Paths: -------------- trunk/epydoc/src/epydoc/apidoc.py Modified: trunk/epydoc/src/epydoc/apidoc.py =================================================================== --- trunk/epydoc/src/epydoc/apidoc.py 2007-09-26 18:42:41 UTC (rev 1654) +++ trunk/epydoc/src/epydoc/apidoc.py 2007-09-26 18:44:11 UTC (rev 1655) @@ -1321,8 +1321,14 @@ def _report_bad_base(self, base): if not isinstance(base, ClassDoc): + if not isinstance(base, GenericValueDoc): + base_name = base.canonical_name + elif base.parse_repr is not UNKNOWN: + base_name = base.parse_repr + else: + base_name = '%r' % base log.warning("%s's base %s is not a class" % - (self.canonical_name, base.canonical_name)) + (self.canonical_name, base_name)) elif base.proxy_for is not None: log.warning("No information available for %s's base %s" % (self.canonical_name, base.proxy_for)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 18:42:42
|
Revision: 1654 http://epydoc.svn.sourceforge.net/epydoc/?rev=1654&view=rev Author: edloper Date: 2007-09-26 11:42:41 -0700 (Wed, 26 Sep 2007) Log Message: ----------- - added target="mainFrame" to epydoc link in page footer. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-26 18:42:09 UTC (rev 1653) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-26 18:42:41 UTC (rev 1654) @@ -1769,7 +1769,8 @@ >>> #endif </td> <td align="right" class="footer"> - <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a> + <a target="mainFrame" href="http://epydoc.sourceforge.net" + >http://epydoc.sourceforge.net</a> </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 18:42:11
|
Revision: 1653 http://epydoc.svn.sourceforge.net/epydoc/?rev=1653&view=rev Author: edloper Date: 2007-09-26 11:42:09 -0700 (Wed, 26 Sep 2007) Log Message: ----------- - Fixed bug where @sort warnings were issued for vars like __author__. - Fixed bug where __author__ etc were ignored if the module docstring was empty. Modified Paths: -------------- trunk/epydoc/src/epydoc/docstringparser.py Modified: trunk/epydoc/src/epydoc/docstringparser.py =================================================================== --- trunk/epydoc/src/epydoc/docstringparser.py 2007-09-26 04:45:34 UTC (rev 1652) +++ trunk/epydoc/src/epydoc/docstringparser.py 2007-09-26 18:42:09 UTC (rev 1653) @@ -185,8 +185,12 @@ initialize_api_doc(api_doc) - # If there's no docstring, then there's nothing more to do. + # If there's no docstring, then check for special variables (e.g., + # __version__), and then return -- there's nothing else to do. if (api_doc.docstring in (None, UNKNOWN)): + if isinstance(api_doc, NamespaceDoc): + for field in STANDARD_FIELDS + user_docfields(api_doc, docindex): + add_metadata_from_var(api_doc, field) return # Remove leading indentation from the docstring. @@ -324,6 +328,9 @@ api_doc.metadata.append( (field, varname, elt) ) if var_doc.docstring in (None, UNKNOWN): del api_doc.variables[varname] + if api_doc.sort_spec is not UNKNOWN: + try: api_doc.sort_spec.remove(varname) + except ValueError: pass def initialize_api_doc(api_doc): """A helper function for L{parse_docstring()} that initializes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 04:45:38
|
Revision: 1652 http://epydoc.svn.sourceforge.net/epydoc/?rev=1652&view=rev Author: edloper Date: 2007-09-25 21:45:34 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Fixed sf bug [ 1673017 ] Graphs are considered inline elements -- graphs are now 'raised' to an appropraite level after the dom tree is created. Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/epytext.py trunk/epydoc/src/epydoc/test/epytext.doctest Modified: trunk/epydoc/src/epydoc/markup/epytext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/epytext.py 2007-09-26 04:00:55 UTC (rev 1651) +++ trunk/epydoc/src/epydoc/markup/epytext.py 2007-09-26 04:45:34 UTC (rev 1652) @@ -316,6 +316,14 @@ "epytext string.") errors.append(StructuringError(estr, token.startline)) + # Graphs use inline markup (G{...}) but are really block-level + # elements; so "raise" any graphs we generated. This is a bit of + # a hack, but the alternative is to define a new markup for + # block-level elements, which I'd rather not do. (See sourceforge + # bug #1673017.) + for child in doc.children: + _raise_graphs(child, doc) + # If there was an error, then signal it! if len([e for e in errors if e.is_fatal()]) > 0: if raise_on_error: @@ -326,6 +334,32 @@ # Return the top-level epytext DOM element. return doc +def _raise_graphs(tree, parent): + # Recurse to children. + have_graph_child = False + for elt in tree.children: + if isinstance(elt, Element): + _raise_graphs(elt, tree) + if elt.tag == 'graph': have_graph_child = True + + block = ('section', 'fieldlist', 'field', 'ulist', 'olist', 'li') + if have_graph_child and tree.tag not in block: + child_index = 0 + for elt in tree.children: + if isinstance(elt, Element) and elt.tag == 'graph': + # We found a graph: splice it into the parent. + parent_index = parent.children.index(tree) + left = tree.children[:child_index] + right = tree.children[child_index+1:] + parent.children[parent_index:parent_index+1] = [ + Element(tree.tag, *left, **tree.attribs), + elt, + Element(tree.tag, *right, **tree.attribs)] + child_index = 0 + parent_index += 2 + else: + child_index += 1 + def _pop_completed_blocks(token, stack, indent_stack): """ Pop any completed blocks off the stack. This includes any Modified: trunk/epydoc/src/epydoc/test/epytext.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/epytext.doctest 2007-09-26 04:00:55 UTC (rev 1651) +++ trunk/epydoc/src/epydoc/test/epytext.doctest 2007-09-26 04:45:34 UTC (rev 1652) @@ -315,4 +315,37 @@ >>> print epytext2html("{{E{lb}E{lb}E{lb}}}") <p>{{{{{}}</p> +Graph Raising +============= +>>> epytext._x = True +>>> print testparse(""" +... Para containing G{classtree} graph. +... """) +<para>Para containing </para> +<graph>classtree</graph> +<para> graph.</para> + +>>> print testparse(""" +... Para B{I{containing C{G{classtree} graph}} inside nested markup}. +... """) +<para>Para <bold><italic>containing <code></code></italic></bold> +</para> +<graph>classtree</graph> +<para><bold><italic><code> graph</code></italic> + inside nested markup</bold> +.</para> + +Should we strip the 'inline' from the paras in cases like this:? +>>> print testparse(""" +... - List item with G{classtree foo} graph. +... - And with I{nested G{callgraph: zippy} markup} too. +... """) +<ulist><li><para inline=True>List item with </para> +<graph>classtreefoo</graph> +<para inline=True> graph.</para></li> +<li><para inline=True>And with <italic>nested </italic> +</para> +<graph>callgraphzippy</graph> +<para inline=True><italic> markup</italic> + too.</para></li></ulist> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 04:00:56
|
Revision: 1651 http://epydoc.svn.sourceforge.net/epydoc/?rev=1651&view=rev Author: edloper Date: 2007-09-25 21:00:55 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Don't issue @sort warnings for special vars __all__, __docformat__, and __path__, since they get supressed by epydoc.docparser. Modified Paths: -------------- trunk/epydoc/src/epydoc/apidoc.py Modified: trunk/epydoc/src/epydoc/apidoc.py =================================================================== --- trunk/epydoc/src/epydoc/apidoc.py 2007-09-26 03:48:06 UTC (rev 1650) +++ trunk/epydoc/src/epydoc/apidoc.py 2007-09-26 04:00:55 UTC (rev 1651) @@ -1007,8 +1007,9 @@ self.sorted_variables.append(unsorted.pop(name)) unused_idents.discard(ident) for ident in unused_idents: - log.warning("@sort: %s.%s not found" % - (self.canonical_name, ident)) + if ident not in ['__all__', '__docformat__', '__path__']: + log.warning("@sort: %s.%s not found" % + (self.canonical_name, ident)) # Add any remaining variables in alphabetical order. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-26 03:48:08
|
Revision: 1650 http://epydoc.svn.sourceforge.net/epydoc/?rev=1650&view=rev Author: edloper Date: 2007-09-25 20:48:06 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Added sanity check to make sure that the base containing an inherited var is acutally a ClassDoc Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-25 23:32:59 UTC (rev 1649) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-26 03:48:06 UTC (rev 1650) @@ -2024,7 +2024,11 @@ for var_doc in var_docs: if var_doc.container != doc: base = var_doc.container - if (base not in self.class_set or + if not isinstance(base, ClassDoc): + # This *should* never happen: + log.warning("%s's container is not a class!" % var_doc) + normal_vars.append(var_doc) + elif (base not in self.class_set or self._inheritance == 'listed'): listed_inh_vars.setdefault(base,[]).append(var_doc) elif self._inheritance == 'grouped': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 23:33:02
|
Revision: 1649 http://epydoc.svn.sourceforge.net/epydoc/?rev=1649&view=rev Author: edloper Date: 2007-09-25 16:32:59 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Added warnings for unused identifiers in @group and @sort fields. This helps catch typos, eg: "@group foo: tree_wlaker" Modified Paths: -------------- trunk/epydoc/src/epydoc/apidoc.py trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/apidoc.py =================================================================== --- trunk/epydoc/src/epydoc/apidoc.py 2007-09-25 22:08:01 UTC (rev 1648) +++ trunk/epydoc/src/epydoc/apidoc.py 2007-09-25 23:32:59 UTC (rev 1649) @@ -994,17 +994,22 @@ # Add any variables that are listed in sort_spec if self.sort_spec is not UNKNOWN: + unused_idents = set(self.sort_spec) for ident in self.sort_spec: if ident in unsorted: - self.sorted_variables.append(unsorted[ident]) - del unsorted[ident] + self.sorted_variables.append(unsorted.pop(ident)) + unused_idents.discard(ident) elif '*' in ident: regexp = re.compile('^%s$' % ident.replace('*', '(.*)')) # sort within matching group? for name, var_doc in unsorted.items(): if regexp.match(name): - self.sorted_variables.append(var_doc) - unsorted.remove(var_doc) + self.sorted_variables.append(unsorted.pop(name)) + unused_idents.discard(ident) + for ident in unused_idents: + log.warning("@sort: %s.%s not found" % + (self.canonical_name, ident)) + # Add any remaining variables in alphabetical order. var_docs = unsorted.items() @@ -1022,6 +1027,7 @@ assert len(self.sorted_variables) == len(self.variables) elts = [(v.name, v) for v in self.sorted_variables] + self._unused_groups = dict([(n,set(i)) for (n,i) in self.group_specs]) self.variable_groups = self._init_grouping(elts) def group_names(self): @@ -1057,27 +1063,37 @@ return {'': [elt[1] for elt in elts]} ungrouped = set([elt_doc for (elt_name, elt_doc) in elts]) + + ungrouped = dict(elts) groups = {} - for (group_name, elt_names) in self.group_specs: - group_re = re.compile('|'.join([n.replace('*','.*')+'$' - for n in elt_names])) - group = groups.get(group_name, []) - for elt_name, elt_doc in list(elts): - if group_re.match(elt_name): - group.append(elt_doc) - if elt_doc in ungrouped: - ungrouped.remove(elt_doc) - else: - # [xx] might just be listed in the same group twice! - log.warning("%s.%s is in multiple groups" % - (self.canonical_name, elt_name)) - groups[group_name] = group + for elt_name, elt_doc in elts: + for (group_name, idents) in self.group_specs: + group = groups.setdefault(group_name, []) + unused_groups = self._unused_groups[group_name] + for ident in idents: + if re.match('^%s$' % ident.replace('*', '(.*)'), elt_name): + unused_groups.discard(ident) + if elt_name in ungrouped: + group.append(ungrouped.pop(elt_name)) + else: + log.warning("%s.%s in multiple groups" % + (self.canonical_name, elt_name)) # Convert ungrouped from an unordered set to an ordered list. groups[''] = [elt_doc for (elt_name, elt_doc) in elts - if elt_doc in ungrouped] + if elt_name in ungrouped] return groups + def report_unused_groups(self): + """ + Issue a warning for any @group items that were not used by + L{_init_grouping()}. + """ + for (group, unused_idents) in self._unused_groups.items(): + for ident in unused_idents: + log.warning("@group %s: %s.%s not found" % + (group, self.canonical_name, ident)) + class ModuleDoc(NamespaceDoc): """ API documentation information about a single module. Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-09-25 22:08:01 UTC (rev 1648) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-09-25 23:32:59 UTC (rev 1649) @@ -291,6 +291,7 @@ val_doc.init_variable_groups() if isinstance(val_doc, ModuleDoc): val_doc.init_submodule_groups() + val_doc.report_unused_groups() log.end_progress() return docindex This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 22:08:03
|
Revision: 1648 http://epydoc.svn.sourceforge.net/epydoc/?rev=1648&view=rev Author: edloper Date: 2007-09-25 15:08:01 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Fixed potential bug, related to sf bug 1682525, which could cause some apidocs to never recieve any canonical name, under certain conditions that involved vars shadowing modules. Modified Paths: -------------- trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-09-25 22:06:15 UTC (rev 1647) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-09-25 22:08:01 UTC (rev 1648) @@ -1131,8 +1131,10 @@ or isinstance(var_doc.value, GenericValueDoc)): continue - # This check is for cases like curses.wrapper, where an - # imported variable shadows its value's "real" location. + # [XX] After svn commit 1644-1647, I'm not sure if this + # ever gets used: This check is for cases like + # curses.wrapper, where an imported variable shadows its + # value's "real" location. if _var_shadows_self(var_doc, varname): _fix_self_shadowing_var(var_doc, varname, docindex) @@ -1169,10 +1171,10 @@ var_doc.value = val_doc return - # If we couldn't find the actual value, then at least - # invalidate the canonical name. - log.warning('%s shadows itself' % varname) - del var_doc.value.canonical_name + # If we couldn't find the actual value, use an unreachable name. + name = _unreachable_name_for(var_doc.value, docindex) + log.warning('%s shadows itself -- using %s instead' % (varname, name)) + var_doc.value.canonical_name = name def _unreachable_name_for(val_doc, docindex): assert isinstance(val_doc, ValueDoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 22:06:17
|
Revision: 1647 http://epydoc.svn.sourceforge.net/epydoc/?rev=1647&view=rev Author: edloper Date: 2007-09-25 15:06:15 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - When checking if a module's vars are imported or not, use the version of the module name with any primes stripped out (primes are added if a submodule is shadowed by its package's vars). Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-09-25 21:37:57 UTC (rev 1646) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-09-25 22:06:15 UTC (rev 1647) @@ -232,6 +232,7 @@ dotted_name = module_doc.canonical_name if dotted_name is UNKNOWN: dotted_name = DottedName(module.__name__) + name_without_primes = DottedName(str(dotted_name).replace("'", "")) # Record the module's parent package, if it has one. if len(dotted_name) > 1: @@ -267,7 +268,7 @@ # value if it's defined in this module. container = get_containing_module(child) if ((container is not None and - container == module_doc.canonical_name) or + container == name_without_primes) or (public_names is not None and child_name in public_names)): # Local variable. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 21:39:55
|
Revision: 1646 http://epydoc.svn.sourceforge.net/epydoc/?rev=1646&view=rev Author: edloper Date: 2007-09-25 14:37:57 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Fixed typo Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-09-25 21:35:17 UTC (rev 1645) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-09-25 21:37:57 UTC (rev 1646) @@ -613,7 +613,7 @@ # differentiate it from the variable that shadows it. if verify_name(value, dotted_name) is UNKNOWN: log.warning("Module %s is shadowed by a variable with " - "the same name." % shadowed_name) + "the same name." % dotted_name) # Note -- this return bypasses verify_name check: return DottedName(value.__name__+"'") except DottedName.InvalidDottedName: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 21:37:09
|
Revision: 1645 http://epydoc.svn.sourceforge.net/epydoc/?rev=1645&view=rev Author: edloper Date: 2007-09-25 14:35:17 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Moved the code that checks for submodules that are shadowed by vars in their containing package(s) -- this is now done inside get_canonical_name(). This ensures that it's always done -- previously, this could get skipped if a module had already been introspected & put into the cache before docbuilder tried to build the docs for the module. - Apparently, inspect.findsource has a bug that can cause it to raise IndexError sometimes (not sure exactly when). If it does, then catch the error, and print a warning, but don't die. Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-09-25 18:42:40 UTC (rev 1644) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-09-25 21:35:17 UTC (rev 1645) @@ -116,6 +116,10 @@ # If we've already introspected this value, then simply return # its ValueDoc from our cache. if pyid in _introspected_values: + # If the file is a script, then adjust its name. + if is_script and filename is not None: + _valuedoc_cache[pyid].canonical_name = DottedName( + munge_script_name(str(filename))) return _valuedoc_cache[pyid] # Create an initial value doc for this value & add it to the cache. @@ -130,11 +134,7 @@ if val_doc.canonical_name is UNKNOWN and name is not None: val_doc.canonical_name = DottedName(name) - # If we were given a filename, but didn't manage to get a - # canonical name, then the module defined by the given file - # must be shadowed by a variable in its parent package(s). - # E.g., this happens with `curses.wrapper`. Add a "'" to - # the end of the name to distinguish it from the variable. + # If the file is a script, then adjust its name. if is_script and filename is not None: val_doc.canonical_name = DottedName(munge_script_name(str(filename))) @@ -606,7 +606,21 @@ # Get the name via introspection. if isinstance(value, ModuleType): - dotted_name = DottedName(value.__name__, strict=strict) + try: + dotted_name = DottedName(value.__name__, strict=strict) + # If the module is shadowed by a variable in its parent + # package(s), then add a prime mark to the end, to + # differentiate it from the variable that shadows it. + if verify_name(value, dotted_name) is UNKNOWN: + log.warning("Module %s is shadowed by a variable with " + "the same name." % shadowed_name) + # Note -- this return bypasses verify_name check: + return DottedName(value.__name__+"'") + except DottedName.InvalidDottedName: + # Name is not a valid Python identifier -- treat as script. + if hasattr(value, '__file__'): + filename = '%s' % value.__str__ + dotted_name = DottedName(munge_script_name(filename)) elif isclass(value): if value.__module__ == '__builtin__': @@ -945,6 +959,9 @@ return lineno + 1 except IOError: pass except TypeError: pass + except IndexError: + log.warning('inspect.findsource(%s) raised IndexError' + % api_doc.canonical_name) return None class _DevNull: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 18:42:41
|
Revision: 1644 http://epydoc.svn.sourceforge.net/epydoc/?rev=1644&view=rev Author: edloper Date: 2007-09-25 11:42:40 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - When drawing class tree & uml graphs for classes, check if there are any private subclasses. If so, generate two separate graphs, one including private subclasses, and the other hiding them; and display them appropriately. - Removed unused 'css' argument to render_graph() Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-25 18:33:58 UTC (rev 1643) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-25 18:42:40 UTC (rev 1644) @@ -840,15 +840,10 @@ (doc.subclasses not in (UNKNOWN,None) and len(doc.subclasses)>0)): # Display bases graphically, if requested. if 'umlclasstree' in self._graph_types: - linker = _HTMLDocstringLinker(self, doc) - graph = uml_class_tree_graph(doc, linker, doc) - out('<center>\n%s</center>\n' % self.render_graph(graph)) + self.write_class_tree_graph(out, doc, uml_class_tree_graph) + elif 'classtree' in self._graph_types: + self.write_class_tree_graph(out, doc, class_tree_graph) - elif 'classtree' in self._graph_types: - linker = _HTMLDocstringLinker(self, doc) - graph = class_tree_graph([doc], linker, doc) - out('<center>\n%s</center>\n' % self.render_graph(graph)) - # Otherwise, use ascii-art. else: # Write the base class tree. @@ -914,6 +909,32 @@ self.write_navbar(out, doc) self.write_footer(out) + def write_class_tree_graph(self, out, doc, graphmaker): + """ + Write HTML code for a class tree graph of C{doc} (a classdoc), + using C{graphmaker} to draw the actual graph. C{graphmaker} + should be L{class_tree_graph()}, or L{uml_class_tree_graph()}, + or any other function with a compatible signature. + + If the given class has any private sublcasses (including + recursive subclasses), then two graph images will be generated + -- one to display when private values are shown, and the other + to display when private values are hidden. + """ + linker = _HTMLDocstringLinker(self, doc) + private_subcls = self._private_subclasses(doc) + if private_subcls: + out('<center>\n' + ' <div class="private">%s</div>\n' + ' <div class="public" style="display:none">%s</div>\n' + '</center>\n' % + (self.render_graph(graphmaker(doc, linker, doc)), + self.render_graph(graphmaker(doc, linker, doc, + exclude=private_subcls)))) + else: + out('<center>\n%s\n</center>\n' % + self.render_graph(graphmaker(doc, linker, doc))) + #//////////////////////////////////////////////////////////// #{ 2.3. Trees pages #//////////////////////////////////////////////////////////// @@ -1450,6 +1471,9 @@ if (elts[i].className == "private") { elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block"); } + else if (elts[i].className == "public") { + elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"block":"none"); + } } // Update all table rows containing private objects. Note, we // use "" instead of "block" becaue IE & firefox disagree on what @@ -1592,8 +1616,7 @@ #{ 2.10. Graphs #//////////////////////////////////////////////////////////// - # [xx] use DotGraph.to_html?? - def render_graph(self, graph, css='graph-without-title'): + def render_graph(self, graph): if graph is None: return '' graph.caption = graph.title = None image_url = '%s.gif' % graph.uid @@ -1626,7 +1649,7 @@ else: uid = callgraph.uid - graph_html = self.render_graph(callgraph, css='graph-with-title') + graph_html = self.render_graph(callgraph) if graph_html == '': rv = "" else: @@ -3375,6 +3398,20 @@ return True return False + def _private_subclasses(self, class_doc): + """Return a list of all subclasses of the given class that are + private, as determined by L{_val_is_private}. Recursive + subclasses are included in this list.""" + queue = [class_doc] + private = set() + for cls in queue: + if (isinstance(cls, ClassDoc) and + cls.subclasses not in (None, UNKNOWN)): + queue.extend(cls.subclasses) + private.update([c for c in cls.subclasses if + not self._val_is_public(c)]) + return private + class _HTMLDocstringLinker(epydoc.markup.DocstringLinker): def __init__(self, htmlwriter, container): self.htmlwriter = htmlwriter This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 18:34:00
|
Revision: 1643 http://epydoc.svn.sourceforge.net/epydoc/?rev=1643&view=rev Author: edloper Date: 2007-09-25 11:33:58 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Removed 'show_private_subclasses' option that was added in the last checkin; replaced it with an 'exclude' option that can be used to exclude selected classes from the tree. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-09-25 18:09:07 UTC (rev 1642) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-09-25 18:33:58 UTC (rev 1643) @@ -1007,7 +1007,7 @@ Return a `DotGraph` that graphically displays the class hierarchy for the given classes. Options: - - show_private_subclasses + - exclude - dir: LR|RL|BT requests a left-to-right, right-to-left, or bottom-to- top, drawing. (corresponds to the dot option 'rankdir' @@ -1020,7 +1020,7 @@ # Options if options.get('dir', 'TB') != 'TB': # default: top-down graph.body += 'rankdir=%s\n' % options.get('dir', 'TB') - show_private_subclasses = options.get('show_private_subclasses', True) + exclude = options.get('exclude', ()) # Find all superclasses & subclasses of the given classes. classes = set(bases) @@ -1028,19 +1028,20 @@ for cls in queue: if isinstance(cls, ClassDoc): if cls.subclasses not in (None, UNKNOWN): - if show_private_subclasses: - subclasses = cls.subclasses - else: - subclasses = [c for c in cls.subclasses - if not c.canonical_name[-1].startswith('_')] + subclasses = cls.subclasses + if exclude: + subclasses = [d for d in subclasses if d not in exclude] queue.extend(subclasses) classes.update(subclasses) queue = list(bases) for cls in queue: if isinstance(cls, ClassDoc): if cls.bases not in (None, UNKNOWN): - queue.extend(cls.bases) - classes.update(cls.bases) + bases = cls.bases + if exclude: + bases = [d for d in bases if d not in exclude] + queue.extend(bases) + classes.update(bases) # Add a node for each cls. classes = [d for d in classes if isinstance(d, ClassDoc) @@ -1063,20 +1064,19 @@ Return a `DotGraph` that graphically displays the class hierarchy for the given class, using UML notation. Options: - - show_private_subclasses - max_attributes - max_operations - show_private_vars - show_magic_vars - link_attributes """ - show_private_subclasses = options.get('show_private_subclasses', True) - nodes = {} # ClassDoc -> DotGraphUmlClassNode + exclude = options.get('exclude', ()) # Create nodes for class_doc and all its bases. for cls in class_doc.mro(): if cls.pyval is object: continue # don't include `object`. + if cls in exclude: break # stop if we get to an excluded class. if cls == class_doc: color = SELECTED_BG else: color = BASECLASS_BG nodes[cls] = DotGraphUmlClassNode(cls, linker, context, @@ -1088,12 +1088,10 @@ for cls in queue: if (isinstance(cls, ClassDoc) and cls.subclasses not in (None, UNKNOWN)): - queue.extend(cls.subclasses) for subcls in cls.subclasses: subcls_name = subcls.canonical_name[-1] - if ( (subcls not in nodes) and - (show_private_subclasses or - not subcls_name.startswith('_')) ): + if subcls not in nodes and subcls not in exclude: + queue.append(subcls) nodes[subcls] = DotGraphUmlClassNode( subcls, linker, context, collapsed=True, bgcolor=SUBCLASS_BG) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-25 18:09:09
|
Revision: 1642 http://epydoc.svn.sourceforge.net/epydoc/?rev=1642&view=rev Author: edloper Date: 2007-09-25 11:09:07 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Added 'show_private_subclasses' option to class_tree_graph and uml_class_tre_graph. - If class_tree_graph is given a classdoc, instead of a list of classes, it will now just use that single classdoc Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-09-24 22:55:21 UTC (rev 1641) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-09-25 18:09:07 UTC (rev 1642) @@ -1005,8 +1005,14 @@ def class_tree_graph(bases, linker, context=None, **options): """ Return a `DotGraph` that graphically displays the class - hierarchy for the given classes. + hierarchy for the given classes. Options: + + - show_private_subclasses + - dir: LR|RL|BT requests a left-to-right, right-to-left, or + bottom-to- top, drawing. (corresponds to the dot option + 'rankdir' """ + if isinstance(bases, ClassDoc): bases = [bases] graph = DotGraph('Class Hierarchy for %s' % name_list(bases, context), body='ranksep=0.3\n', edge_defaults={'sametail':True, 'dir':'none'}) @@ -1014,6 +1020,7 @@ # Options if options.get('dir', 'TB') != 'TB': # default: top-down graph.body += 'rankdir=%s\n' % options.get('dir', 'TB') + show_private_subclasses = options.get('show_private_subclasses', True) # Find all superclasses & subclasses of the given classes. classes = set(bases) @@ -1021,8 +1028,13 @@ for cls in queue: if isinstance(cls, ClassDoc): if cls.subclasses not in (None, UNKNOWN): - queue.extend(cls.subclasses) - classes.update(cls.subclasses) + if show_private_subclasses: + subclasses = cls.subclasses + else: + subclasses = [c for c in cls.subclasses + if not c.canonical_name[-1].startswith('_')] + queue.extend(subclasses) + classes.update(subclasses) queue = list(bases) for cls in queue: if isinstance(cls, ClassDoc): @@ -1050,15 +1062,18 @@ """ Return a `DotGraph` that graphically displays the class hierarchy for the given class, using UML notation. Options: - + + - show_private_subclasses - max_attributes - max_operations - show_private_vars - show_magic_vars - link_attributes """ + show_private_subclasses = options.get('show_private_subclasses', True) + nodes = {} # ClassDoc -> DotGraphUmlClassNode - + # Create nodes for class_doc and all its bases. for cls in class_doc.mro(): if cls.pyval is object: continue # don't include `object`. @@ -1074,11 +1089,14 @@ if (isinstance(cls, ClassDoc) and cls.subclasses not in (None, UNKNOWN)): queue.extend(cls.subclasses) - for cls in cls.subclasses: - if cls not in nodes: - nodes[cls] = DotGraphUmlClassNode(cls, linker, context, - collapsed=True, - bgcolor=SUBCLASS_BG) + for subcls in cls.subclasses: + subcls_name = subcls.canonical_name[-1] + if ( (subcls not in nodes) and + (show_private_subclasses or + not subcls_name.startswith('_')) ): + nodes[subcls] = DotGraphUmlClassNode( + subcls, linker, context, collapsed=True, + bgcolor=SUBCLASS_BG) # Only show variables in the class where they're defined for # *class_doc*. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-09-24 22:55:22
|
Revision: 1641 http://epydoc.svn.sourceforge.net/epydoc/?rev=1641&view=rev Author: dvarrazzo Date: 2007-09-24 15:55:21 -0700 (Mon, 24 Sep 2007) Log Message: ----------- - Don't assume Python sources really exist in the file system: with some import hooks (e.g. compressed .egg) this is not the case. Modified Paths: -------------- trunk/epydoc/src/epydoc/util.py Modified: trunk/epydoc/src/epydoc/util.py =================================================================== --- trunk/epydoc/src/epydoc/util.py 2007-09-24 22:46:11 UTC (rev 1640) +++ trunk/epydoc/src/epydoc/util.py 2007-09-24 22:55:21 UTC (rev 1641) @@ -37,6 +37,7 @@ def is_src_filename(filename): if not isinstance(filename, basestring): return False + if not os.path.exists(filename): return False return os.path.splitext(filename)[1] in PY_SRC_EXTENSIONS def is_package_dir(dirname): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-09-24 22:46:12
|
Revision: 1640 http://epydoc.svn.sourceforge.net/epydoc/?rev=1640&view=rev Author: dvarrazzo Date: 2007-09-24 15:46:11 -0700 (Mon, 24 Sep 2007) Log Message: ----------- - Check the container is really a namespace: in case of masked modules, container() may return the wrong object. An example is SQLAlchemy 0.3.10: the MapperExtension class appears contained in... the mapper() function! (which actually hides the mapper module). Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-24 21:39:48 UTC (rev 1639) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-24 22:46:11 UTC (rev 1640) @@ -3054,7 +3054,7 @@ def _val_is_public(self, valdoc): """Make a best-guess as to whether the given class is public.""" container = self.docindex.container(valdoc) - if container is not None: + if isinstance(container, NamespaceDoc): for vardoc in container.variables.values(): if vardoc in (UNKNOWN, None): continue if vardoc.value is valdoc: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-24 21:39:49
|
Revision: 1639 http://epydoc.svn.sourceforge.net/epydoc/?rev=1639&view=rev Author: edloper Date: 2007-09-24 14:39:48 -0700 (Mon, 24 Sep 2007) Log Message: ----------- - Fixed typo Modified Paths: -------------- trunk/epydoc/src/epydoc/util.py Modified: trunk/epydoc/src/epydoc/util.py =================================================================== --- trunk/epydoc/src/epydoc/util.py 2007-09-24 18:45:54 UTC (rev 1638) +++ trunk/epydoc/src/epydoc/util.py 2007-09-24 21:39:48 UTC (rev 1639) @@ -42,7 +42,7 @@ def is_package_dir(dirname): """ Return true if the given directory is a valid package directory - (i.e., it names a directory that contsains a valid __init__ file, + (i.e., it names a directory that contains a valid __init__ file, and its name is a valid identifier). """ # Make sure it's a directory name. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-09-24 18:45:57
|
Revision: 1638 http://epydoc.svn.sourceforge.net/epydoc/?rev=1638&view=rev Author: edloper Date: 2007-09-24 11:45:54 -0700 (Mon, 24 Sep 2007) Log Message: ----------- - Fixed sf bug 1678046 -- see bug for details. (had to do with merging generic valuedocs) Modified Paths: -------------- trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-09-24 18:42:16 UTC (rev 1637) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-09-24 18:45:54 UTC (rev 1638) @@ -801,20 +801,13 @@ # If both values are GenericValueDoc, then we don't want to merge # them. E.g., we don't want to merge 2+2 with 4. So just copy - # the inspect_doc's pyval to the parse_doc, and return the parse_doc. - # - # This operation has been suspended for the reason explained in - # SF bug 1678046: the values can be totally uncorrelated if the - # introspected value has been changed as collateral effect by a function - # executed at runtime. - # - #if type(introspect_doc) == type(parse_doc) == GenericValueDoc: - #if introspect_doc.pyval is not UNKNOWN: - #parse_doc.pyval = introspect_doc.pyval - #if introspect_doc.parse_repr is not UNKNOWN: - #parse_doc.parse_repr = introspect_doc.parse_repr - #parse_doc.docs_extracted_by = 'both' - #return parse_doc.merge_and_overwrite(introspect_doc) + # the parse_doc's parse_repr to introspect_doc, & return it. + # (In particular, do *not* call merge_and_overwrite.) + if type(introspect_doc) == type(parse_doc) == GenericValueDoc: + if parse_doc.parse_repr is not UNKNOWN: + introspect_doc.parse_repr = parse_doc.parse_repr + introspect_doc.docs_extracted_by = 'both' + return introspect_doc # Perform several sanity checks here -- if we accidentally # merge values that shouldn't get merged, then bad things can This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |