[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/File/Views/VFS - VFSFileView.py:1.3

Stephan Richter srichter@cbu.edu
Sat, 29 Jun 2002 11:42:11 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/File/Views/VFS
In directory cvs.zope.org:/tmp/cvs-serv22238/lib/python/Zope/App/OFS/Content/File/Views/VFS

Modified Files:
	VFSFileView.py 
Log Message:
Okay, I fixed the the VFS implementation again. There is quiet some work left 
though. We have to get rid of the _traverse view for folders, then I can do 
some more. Also, I still have to do some general cleanup in the Publisher 
and Traverser.


=== Zope3/lib/python/Zope/App/OFS/Content/File/Views/VFS/VFSFileView.py 1.2 => 1.3 ===
 
 import time
+from Zope.Publisher.VFS.VFSView import VFSView
 from Zope.Publisher.VFS.IVFSFilePublisher import IVFSFilePublisher
 
 
-class VFSFileView:
+class VFSFileView(VFSView):
 
-    __implements__ = IVFSFilePublisher
+    __implements__ = IVFSFilePublisher, VFSView.__implements__
 
-    def __init__(self, context):
-        """ """
-        self._object = context
 
     ############################################################
     # Implementation methods for interface
@@ -34,7 +32,7 @@
 
     def read(self, mode, outstream, start = 0, end = -1):
         """See Zope.Publisher.VFS.IVFSFilePublisher.IVFSFilePublisher"""
-        data = self._object.getData()
+        data = self.context.getData()
         try:
             if start != 0: data = data[start:]
             if end != -1: data = data[:end]
@@ -49,7 +47,7 @@
             instream.seek(start)
         except:
             pass
-        self._object.setData(instream.read())
+        self.context.setData(instream.read())
 
 
     def check_writable(self, mode):
@@ -73,11 +71,11 @@
         """See Zope.Publisher.VFS.IVFSObjectPublisher.IVFSObjectPublisher"""
         t = time.time()
         size = 0
-        if hasattr(self._object, 'getSize'):
-            size = self._object.getSize()
+        if hasattr(self.context, 'getSize'):
+            size = self.context.getSize()
         uid = 0
         gid = 0
-        return (0, 0, 0, 0, uid, gid, size, t, t, t)
+        return (511, 0, 0, 0, uid, gid, size, t, t, t)
 
 
     ######################################