[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - syncer.py:1.26

Fred L. Drake, Jr. fred@zope.com
Fri, 18 Jul 2003 09:39:10 -0400


Update of /cvs-repository/Zope3/src/zope/app/fssync
In directory cvs.zope.org:/tmp/cvs-serv25452

Modified Files:
	syncer.py 
Log Message:
- never write comments late at night!  remove bogosity.
- add new comments and some assertions


=== Zope3/src/zope/app/fssync/syncer.py 1.25 => 1.26 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.25	Fri Jul 18 00:18:25 2003
+++ Zope3/src/zope/app/fssync/syncer.py	Fri Jul 18 09:39:04 2003
@@ -89,7 +89,9 @@
     try:
         objectPath = str(getPath(ob))
     except (TypeError, KeyError):
-        objectPath = ''
+        # this case can be triggered for persistent objects that don't
+        # have a name in the content space (annotations, extras)
+        pass
     else:
         entries[name]['path'] = objectPath
 
@@ -118,25 +120,16 @@
         annotation_dir = os.path.join(annotation_dir, name)
         if not os.path.exists(annotation_dir):
             os.mkdir(annotation_dir)
-
-        # XXX This doesn't allow an interface that's implemented as an
-        # adapter that uses annotations to store data to affect the
-        # serialized representation of the data.  Case in point: the
-        # IAnnotatable --> ZopeDublinCore adapter
-        # (zope.app.dublincore.annotatableadapter.ZDCAnnotationAdapter)
-        # uses a PersistentDict as the storage format, but could
-        # benefit by storing the data as RDF encoded in XML (for
-        # example).  Perhaps marker interfaces could be used on in
-        # PersistentDict instance to support this?
-
         for key in annotations:
             annotation = annotations[key]
             toFS(annotation, key, annotation_dir)
 
     # Handle data
     if IObjectFile.isImplementedBy(adapter):
+        assert not IObjectDirectory.isImplementedBy(adapter)
         # File
         data = ''
+        # XXX shouldn't need this if
         if not os.path.exists(path):
             data = adapter.getBody()
             writeFile(data, path)