[Zope3-checkins] CVS: Zope3/src/zope/app/dublincore - dcterms.py:1.4
Fred L. Drake, Jr.
fred at zope.com
Fri Aug 22 10:09:38 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/dublincore
In directory cvs.zope.org:/tmp/cvs-serv21893
Modified Files:
dcterms.py
Log Message:
check_period(): use the new dcsv.createMapping() convenience function
=== Zope3/src/zope/app/dublincore/dcterms.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/dublincore/dcterms.py:1.3 Thu Aug 21 01:20:40 2003
+++ Zope3/src/zope/app/dublincore/dcterms.py Fri Aug 22 09:09:37 2003
@@ -82,15 +82,10 @@
# checks a Period in DCSV format; see:
# http://dublincore.org/documents/dcmi-period/
items = dcsv.decode(value)
- d = {}
- for k, v in items:
- if not k:
- raise ValueError("missing field label")
+ d = dcsv.createMapping(items)
+ for k in d:
if k not in _period_fields:
raise ValueError("unknown field label %r" % k)
- if k in d:
- raise ValueError("duplicate field label %r" % k)
- d[k] = v
if d.get("scheme", W3CDTF).upper() == W3CDTF:
if "start" in d:
check_w3cdtf(d["start"])
More information about the Zope3-Checkins
mailing list