Re: [Zope3-Users] BrowserResponse, write()

2005-09-16 Thread Andreas Reuleaux
I just got this answer from Jim by private e-mail
- which is my fault, as I had e-mailed him privately
before:

On Fri, Sep 16, 2005 at 12:53:42PM -0400, Jim Fulton wrote:
> ...
> Was there a reason to use response.write rather than
> returning the pdf as a string?
> 
> Jim
> ...

First of all: Yes, this seems to be the solution as Stephan has also
pointed out:

  def __call__(self):
pdf = ...
response=self.request.response
response.setHeader(...)
return pdf.data

Thanks for that.

To answer Jims question: I am not sure, I guess the onliest
reason to use response.write(pdf.data) was that just returning
pdf.data didn't work properly before(?), concluding from 
Stephans answer:

On Fri, Sep 16, 2005 at 11:50:19AM -0400, Stephan Richter wrote:
> Just return the data; it is handled properly now.

Maybe Philipp has a better answer.

-Andreas
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] BrowserResponse, write()

2005-09-16 Thread Andreas Reuleaux
On Fri, Sep 16, 2005 at 11:58:41AM -0400, Jim Fulton wrote:
> Stephan Richter wrote:
> >On Friday 16 September 2005 11:39, Andreas Reuleaux wrote:
> >
> >>What else should be used now? - Not sure if this has been discussed
> >>before.
> >
> >
> >Just return the data; it is handled properly now. You could even create a 
> >file stream now, if there is a lot of data.
> 
> Stephan, that's not much of an explanation.
> 
> Andreas, we didn't think response.write was being used. What are you trying 
> to do?

Well, I was trying to send some pdf back to the browser,
very similar to Example 12.2.4, p. 194 from Philipps book
(not with recipes but addresses though).

-Andreas


PS: Sorry for the private e-mail, I meant to do a list reply


> 
> Stephan, we may have to provide backward compatibility. since it's in
> Philipps book.
> 
> Jim
> 
> -- 
> Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
> CTO  (540) 361-1714http://www.python.org
> Zope Corporation http://www.zope.com   http://www.zope.org
> ___
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
> 
> 
> !DSPAM:432af01635942140615811!
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] BrowserResponse, write()

2005-09-16 Thread Jim Fulton

Stephan Richter wrote:

On Friday 16 September 2005 11:39, Andreas Reuleaux wrote:


What else should be used now? - Not sure if this has been discussed
before.



Just return the data; it is handled properly now. You could even create a file 
stream now, if there is a lot of data.


Stephan, that's not much of an explanation.

Andreas, we didn't think response.write was being used. What are you trying to 
do?

Stephan, we may have to provide backward compatibility. since it's in
Philipps book.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] BrowserResponse, write()

2005-09-16 Thread Stephan Richter
On Friday 16 September 2005 11:39, Andreas Reuleaux wrote:
> What else should be used now? - Not sure if this has been discussed
> before.

Just return the data; it is handled properly now. You could even create a file 
stream now, if there is a lot of data.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users