On Thu, Apr 19, 2012 at 15:37, Tom Sheffler <[email protected]> wrote:
> Is this the best (or recommended) way to create such a response?
I don't think there's any need to close your StringIO. You can also
use cStringIO.StringIO for better performance. And you can just
return a string from your render_GET. So, like this (untested):
def render_GET(self, response):
output = cStringIO.StringIO()
output.write("...")
output.write("...")
return output.getvalue()
Ivan
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web