[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - classes.py:1.8 committer.py:1.12 syncer.py:1.24

Guido van Rossum guido@python.org
Mon, 9 Jun 2003 14:49:22 -0400


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

Modified Files:
	classes.py committer.py syncer.py 
Log Message:
Add annotations() to the IObjectEntry interface.  This makes the
treatment of extra() and annotations() more similar, and allows an
adapter to trap the annotations as they are going to or coming from
disk.


=== Zope3/src/zope/app/fssync/classes.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/fssync/classes.py:1.7	Fri Jun  6 15:29:02 2003
+++ Zope3/src/zope/app/fssync/classes.py	Mon Jun  9 14:48:52 2003
@@ -21,6 +21,8 @@
 from zope.app.content.file import File
 from zope.app.content.folder import Folder
 from zope.app.interfaces.fssync import IFSAddView, IObjectFile
+from zope.app.interfaces.annotation import IAnnotations
+from zope.component import queryAdapter
 from zope.component.interfaces import IPresentationRequest
 from zope.xmlpickle import dumps
 from zope.proxy import removeAllProxies
@@ -89,16 +91,20 @@
         self.context = context
 
     def extra(self):
-        "See Zope.App.FSSync.IObjectEntry.IObjectEntry"
+        "See IObjectEntry"
         return None
 
+    def annotations(self):
+        "See IObjectEntry"
+        return queryAdapter(self.context, IAnnotations)
+
     def typeIdentifier(self):
-        "See Zope.App.FSSync.IObjectEntry.IObjectEntry"
+        "See IObjectEntry"
         class_ = self.context.__class__
         return "%s.%s" % (class_.__module__, class_.__name__)
 
     def factory(self):
-        "See Zope.App.FSSync.IObjectEntry.IObjectEntry"
+        "See IObjectEntry"
         # Return the dotted class name, assuming that it can be used
         class_ = self.context.__class__
         return "%s.%s" % (class_.__module__, class_.__name__)


=== Zope3/src/zope/app/fssync/committer.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/fssync/committer.py:1.11	Thu Jun  5 17:50:46 2003
+++ Zope3/src/zope/app/fssync/committer.py	Mon Jun  9 14:48:52 2003
@@ -30,7 +30,6 @@
 from zope.app.interfaces.fssync \
      import IObjectEntry, IObjectDirectory, IObjectFile
 
-from zope.app.interfaces.annotation import IAnnotations
 from zope.app.interfaces.container import IContainer, IZopeContainer
 from zope.app.fssync.classes import Default
 from zope.app.traversing import getPath, traverseName, objectName
@@ -111,7 +110,7 @@
                 extrapath = fsutil.getextra(fspath)
                 if extra is not None and os.path.exists(extrapath):
                     self.check_dir(extra, extrapath)
-                ann = queryAdapter(obj, IAnnotations)
+                ann = adapter.annotations()
                 annpath = fsutil.getannotations(fspath)
                 if ann is not None and os.path.exists(annpath):
                     self.check_dir(ann, annpath)
@@ -243,7 +242,7 @@
                 extrapath = fsutil.getextra(fspath)
                 if extra is not None and os.path.exists(extrapath):
                     self.synch_dir(extra, extrapath)
-                ann = queryAdapter(obj, IAnnotations)
+                ann = adapter.annotations()
                 annpath = fsutil.getannotations(fspath)
                 if ann is not None and os.path.exists(annpath):
                     self.synch_dir(ann, annpath)


=== Zope3/src/zope/app/fssync/syncer.py 1.23 => 1.24 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.23	Wed May 28 13:29:50 2003
+++ Zope3/src/zope/app/fssync/syncer.py	Mon Jun  9 14:48:52 2003
@@ -23,7 +23,6 @@
 from zope.app.interfaces.fssync \
      import IObjectEntry, IObjectDirectory, IObjectFile
 
-from zope.app.interfaces.annotation import IAnnotations
 from zope.app.interfaces.container import IContainer
 from zope.configuration.name import resolve
 from zope.app.fssync.classes import Default
@@ -111,7 +110,7 @@
             toFS(edata, ename, extra_dir)
 
     # Handle annotations
-    annotations = queryAdapter(ob, IAnnotations)
+    annotations = adapter.annotations()
     if annotations is not None:
         annotation_dir = os.path.join(admin_dir, 'Annotations')
         if not os.path.exists(annotation_dir):