[Zope3-checkins] CVS: Zope3/src/zope/fssync/server -
entryadapter.py:1.2.6.1
Philipp von Weitershausen
philikon at philikon.de
Sun Feb 8 09:18:41 EST 2004
Update of /cvs-repository/Zope3/src/zope/fssync/server
In directory cvs.zope.org:/tmp/cvs-serv13863/fssync/server
Modified Files:
Tag: philikon-movecontent-branch
entryadapter.py
Log Message:
DirectoryAdapter was defined for folders but is good for all kinds of
folderish/containerish objects, and in fact used by them; thus it only
makes sense to move it to this central place.
=== Zope3/src/zope/fssync/server/entryadapter.py 1.2 => 1.2.6.1 ===
--- Zope3/src/zope/fssync/server/entryadapter.py:1.2 Tue Jan 13 17:28:47 2004
+++ Zope3/src/zope/fssync/server/entryadapter.py Sun Feb 8 09:18:41 2004
@@ -17,7 +17,7 @@
"""
from zope.component import queryAdapter
-from zope.fssync.server.interfaces import IObjectFile
+from zope.fssync.server.interfaces import IObjectFile, IContentDirectory
from zope.interface import implements
from zope.proxy import removeAllProxies
from zope.xmlpickle import toxml
@@ -111,3 +111,14 @@
# if that's not the case, then either this method needs to be
# overridden or this class shouldn't be used.
return None
+
+class DirectoryAdapter(ObjectEntryAdapter):
+ """Folder adapter to provide a file-system representation.
+ """
+ implements(IContentDirectory)
+
+ def contents(self):
+ result = []
+ for name, object in self.context.items():
+ result.append((name, object))
+ return result
More information about the Zope3-Checkins
mailing list