[Zope3-checkins] CVS: Zope3/src/zope/app/dublincore -
annotatableadapter.py:1.7
Jim Fulton
jim at zope.com
Thu Mar 4 17:42:03 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/dublincore
In directory cvs.zope.org:/tmp/cvs-serv4095/src/zope/app/dublincore
Modified Files:
annotatableadapter.py
Log Message:
Got rid of some code that:
- Didn't make any sense. It Checked for a data type that couldn't be
there, and
- was fooled by security proxies.
=== Zope3/src/zope/app/dublincore/annotatableadapter.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/dublincore/annotatableadapter.py:1.6 Fri Feb 20 11:57:25 2004
+++ Zope3/src/zope/app/dublincore/annotatableadapter.py Thu Mar 4 17:42:01 2004
@@ -39,18 +39,9 @@
def __init__(self, context):
annotations = getAdapter(context, IAnnotations)
dcdata = annotations.get(DCkey)
- if not dcdata:
+ if dcdata is None:
self.annotations = annotations
dcdata = ZDCAnnotationData()
- elif not isinstance(dcdata, ZDCAnnotationData):
- # Convert mapping to a ZDCAnnotationData, and set things
- # up so that the annotations object is only updated the
- # first time we're writing to it; this avoids converting
- # it when we wouldn't otherwise write to the object.
- self.annotations = annotations
- d = ZDCAnnotationData()
- d.update(dcdata)
- dcdata = d
super(ZDCAnnotatableAdapter, self).__init__(dcdata)
More information about the Zope3-Checkins
mailing list