[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/File - File.py:1.1.2.2

Stephan Richter srichter@cbu.edu
Thu, 28 Mar 2002 18:53:14 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	File.py 
Log Message:
Resolved Issue 45

It was actually just a small bug in the File's setData() method and 
a bug in how setData() worked in Image.


=== Zope3/lib/python/Zope/App/OFS/Content/File/File.py 1.1.2.1 => 1.1.2.2 ===
     def edit(self, data, contentType=None):
         '''See interface IFile'''
-        self.setData(data)
         if contentType is not None:
             self._contentType = contentType
+        self.setData(data)
 
 
     def getData(self):
@@ -87,7 +87,9 @@
         if isinstance(data, StringType):
             size = len(data)
             if size < MAXCHUNKSIZE:
+                print 'and here'
                 self._data, self._size = FileChunk(data), size
+                print self._data
                 return None
             self._data, self._size = FileChunk(data), size
             return None
@@ -112,7 +114,7 @@
 
         if size <= 2*MAXCHUNKSIZE:
             seek(0)
-            if size < n:
+            if size < MAXCHUNKSIZE:
                 self._data, self._size = read(size), size
                 return None
             self._data, self._size = FileChunk(read(size)), size