[Zope3-checkins] CVS: Zope3/src/zope/app/content - configure.zcml:1.16 fssync.py:1.5

Guido van Rossum guido@python.org
Thu, 15 May 2003 12:57:20 -0400


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

Modified Files:
	configure.zcml fssync.py 
Log Message:
Change some class names in fssync.py.  Add a DTMLPage adapter.


=== Zope3/src/zope/app/content/configure.zcml 1.15 => 1.16 ===
--- Zope3/src/zope/app/content/configure.zcml:1.15	Thu May 15 12:20:09 2003
+++ Zope3/src/zope/app/content/configure.zcml	Thu May 15 12:57:19 2003
@@ -359,31 +359,33 @@
 
 <fssync:adapter factory="zope.app.fssync.classes.Default" />
 
-<fssync:adapter class=".file.File" factory=".fssync.ObjectFileAdapter" />
+<fssync:adapter class=".file.File" factory=".fssync.FileAdapter" />
 
-<fssync:adapter class=".image.Image" factory=".fssync.ObjectFileAdapter" />
+<fssync:adapter class=".image.Image" factory=".fssync.FileAdapter" />
 
-<fssync:adapter class=".folder.Folder" factory=".fssync.ObjectDirectory" />
+<fssync:adapter class=".folder.Folder" factory=".fssync.DirectoryAdapter" />
 
-<fssync:adapter class=".zpt.ZPTPage" factory=".fssync.ZPTObjectFileAdapter" />
+<fssync:adapter class=".zpt.ZPTPage" factory=".fssync.ZPTPageAdapter" />
+
+<fssync:adapter class=".dtmlpage.DTMLPage" factory=".fssync.DTMLPageAdapter" />
 
   <!-- zope:adapter directives -->
 
 <adapter
   for="zope.app.interfaces.content.file.IFile"
-  factory=".fssync.ObjectFileAdapter"
+  factory=".fssync.FileAdapter"
   provides="zope.app.interfaces.fssync.IObjectFile"
   />
 
 <adapter
   for="zope.app.interfaces.content.folder.IFolder"
-  factory=".fssync.ObjectDirectory"
+  factory=".fssync.DirectoryAdapter"
   provides="zope.app.interfaces.fssync.IObjectDirectory"
   />
 
 <adapter
   for="zope.app.interfaces.content.zpt.IZPTPage"
-  factory=".fssync.ObjectFileAdapter"
+  factory=".fssync.FileAdapter"
   provides="zope.app.interfaces.fssync.IObjectFile"
   />
 


=== Zope3/src/zope/app/content/fssync.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/content/fssync.py:1.4	Thu May 15 12:20:09 2003
+++ Zope3/src/zope/app/content/fssync.py	Thu May 15 12:57:19 2003
@@ -24,47 +24,49 @@
 from zope.app.interfaces.fssync import IObjectFile, IContentDirectory
 from zope.proxy.context import ContextWrapper
 
-_attrs = ('contentType', )
-
-class ObjectFileAdapter(ObjectEntryAdapter):
+class FileAdapter(ObjectEntryAdapter):
     """ObjectFile adapter for file objects."""
 
     __implements__ =  IObjectFile
 
     def getBody(self):
-        "See IObjectFile"
         return self.context.getData()
 
     def setBody(self, data):
-        "See IObjectFile"
         self.context.setData(data)
 
     def extra(self):
-        "See IObjectEntry"
-        return AttrMapping(self.context, _attrs)
+        return AttrMapping(self.context, ('contentType',))
 
-class ObjectDirectory(ObjectEntryAdapter):
+class DirectoryAdapter(ObjectEntryAdapter):
     """Folder adapter to provide a file-system representation."""
 
     __implements__ =  IContentDirectory
 
     def contents(self):
-        "See IObjectDirectory"
         result = []
         for name, object in self.context.items():
             object = ContextWrapper(object, self.context, name=name)
             result.append((name, object))
         return result
 
-class ZPTObjectFileAdapter(ObjectEntryAdapter):
+class ZPTPageAdapter(ObjectEntryAdapter):
     """ObjectFile adapter for ZPT page objects."""
 
     __implements__ =  IObjectFile
 
     def getBody(self):
-        "See IObjectFile"
         return self.context.getSource()
 
     def setBody(self, data):
-        "See IObjectFile"
+        self.context.setSource(data)
+
+class DTMLPageAdapter(ObjectEntryAdapter):
+
+    __implements__ = IObjectFile
+
+    def getBody(self):
+        return self.context.getSource()
+
+    def setBody(self, data):
         self.context.setSource(data)