[Zope-Checkins] CVS: Zope/lib/python/OFS - Image.py:1.145.2.5.2.3

Chris McDonough chrism at plope.com
Sun Mar 28 01:12:39 EST 2004


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv9701/OFS

Modified Files:
      Tag: chrism-publishfile-branch
	Image.py 
Log Message:
Instead of returning a producer directly, return a StreamIterator which is then turned into a producer.  This provides better encapsulation, as Zope app code won't depend on ZServer in places where it returns an iterator (instead it will depend only on ZPublisher).


=== Zope/lib/python/OFS/Image.py 1.145.2.5.2.2 => 1.145.2.5.2.3 ===
--- Zope/lib/python/OFS/Image.py:1.145.2.5.2.2	Wed Mar 24 02:49:47 2004
+++ Zope/lib/python/OFS/Image.py	Sun Mar 28 01:12:01 2004
@@ -33,7 +33,7 @@
 from ZPublisher.HTTPRequest import FileUpload
 from zExceptions import Redirect
 from cgi import escape
-from ZServer.medusa.producers import file_producer 
+from ZPublisher.Iterators import filestream_iterator
 import stat
 import os
 
@@ -394,15 +394,8 @@
             result = self.ZCacheable_get(default=None)
             if result is not None:
                 # We will always get None from RAMCacheManager but we will get
-                # something implementing the IZServerProducer interface
-                # from FileCacheManager.  Returning something to the publisher
-                # that implements the IZServerProducer interface (presumably
-                # wrapped around a stream or a disk file) allows us to send the
-                # content down to the client as fast as possible without the
-                # computational/IO expense of reading from the ZODB
-                # and without the computational/memory expense of reading a
-                # arbitrarily large file into memory from disk and sending it
-                # back as a huge string.
+                # something implementing the IStreamIterator interface
+                # from FileCacheManager.
                 return result
             
         self.ZCacheable_set(None)




More information about the Zope-Checkins mailing list