Jeff Shell wrote:
On 12/23/05, Jim Fulton <[EMAIL PROTECTED]> wrote:
I've been working on trying to clean up the IResult/response.write mess.
I want to retract IResult from the public API.
Here's what I propose to do:
- Move IResult from zope.publisher.interfaces.http to
zope.publisher.http, thus making it a private interface.
- I'm arranging that a published method can simply return a file,
rather than a string. This will be how you can efficiently
return large results.
By file, do you mean a Python ``file`` object?
Yes, or the result of tempfile.TemporaryFile.
Will StringIO suffice?
What would be the point? The whole purpose if this
is to avoid loading all of the data into memory.
Or will a very simple interface like IReadFile
(zope.app.filerepresentation) be enough?
There is an adapter that is registered for file
and for the result of calling tempfile.TemporaryFile.
The adapter could be registered for other types, but,
due toa bug in Twisted's WSGI support, the thing
has to be pretty darn file-like, to the point that it
has to have a fileno method.
Jim Fulton mailto:[EMAIL PROTECTED] Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
Zope3-dev mailing list