[Epydoc-commits] SF.net SVN: epydoc: [1578] trunk/epydoc/src/epydoc/docstringparser.py
Brought to you by:
edloper
|
From: <dva...@us...> - 2007-03-10 00:10:35
|
Revision: 1578
http://svn.sourceforge.net/epydoc/?rev=1578&view=rev
Author: dvarrazzo
Date: 2007-03-09 16:10:33 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
- Variables don't add metadata to multivalue fields, if a value is already
present.
- Somewhat optimized check to test if a variable is to be used as metadata.
Modified Paths:
--------------
trunk/epydoc/src/epydoc/docstringparser.py
Modified: trunk/epydoc/src/epydoc/docstringparser.py
===================================================================
--- trunk/epydoc/src/epydoc/docstringparser.py 2007-03-09 23:26:21 UTC (rev 1577)
+++ trunk/epydoc/src/epydoc/docstringparser.py 2007-03-10 00:10:33 UTC (rev 1578)
@@ -267,13 +267,18 @@
report_errors(api_doc, docindex, parse_errors, field_warnings)
def add_metadata_from_var(api_doc, field):
- if not field.multivalue:
- for (f,a,d) in api_doc.metadata:
- if field == f:
- return # We already have a value for this metadata.
for varname in field.varnames:
# Check if api_doc has a variable w/ the given name.
if varname not in api_doc.variables: continue
+
+ # Check moved here from before the for loop because we expect to
+ # reach rarely this point. The loop below is to be performed more than
+ # once only for fields with more than one varname, which currently is
+ # only 'author'.
+ for md in api_doc.metadata:
+ if field == md[0]:
+ return # We already have a value for this metadata.
+
var_doc = api_doc.variables[varname]
if var_doc.value is UNKNOWN: continue
val_doc = var_doc.value
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|