On Mon, Jun 14, 2010 at 8:38 AM, Itamar Turner-Trauring <span dir="ltr">&lt;<a href="mailto:itamar@itamarst.org">itamar@itamarst.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, 2010-06-14 at 08:22 -0500, Allen Bierbaum wrote:<br>
<br>
&gt; 1) Is there any method to stream a large request (ex: PUT or POST with<br>
&gt; file upload) into the system or does the entire body have to be loaded<br>
&gt; into memory as part of the request?<br>
<br>
</div>Very large requests get written to disk, rather than memory. This is<br>
still not ideal, streaming is obviously better - someone may be able to<br>
suggest how to do it until Twisted gets fixed.<br></blockquote><div><br></div><div>That is unfortunate.  Do you know of an example that shows to get access to that file or does it just show up as a file object in the request?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt; 2) Has anyone used an existing URL Routing system (ex: Routes [1],<br>
&gt; Selector [2]) and adapted it for use with Twisted?  (I know I could<br>
&gt; use the twisted preferred method of parent child hierarchies, but our<br>
&gt; application has a better fit with the route-based method used by<br>
&gt; Pylons, Django, Rails, etc)<br>
<br>
</div>Set isLeaf=True on the Resource, and then render() will get called for<br>
all sub-paths, and at that point you can dispatch using one of those<br>
libraries.<br></blockquote><div><br></div><div>I will have to try that.  I think it may have problems due to those systems relying upon the WSGI interface and thus the environ dictionary.  I am guessing I will have to hack them up a bit to make it work.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
&gt; 3) Is there a document anywhere that describes all the environment<br>
&gt; variables the user can get from the request and how to get to them?<br>
&gt;  (something like the environ section of the WSGI PEP [3])<br>
<br>
</div>Request objects do not provide any environment variables (that&#39;s an<br>
operating system concept). They provide information about the HTTP<br>
request. This includes the method, path, and HTTP headers sent by the<br>
client. </blockquote><div><br></div><div>I mispoke.  I didn&#39;t mean the OS environment variables, I meant the equivalent of the WSGI environ dictionary (the CGI environment).  The link below looks like a great starting point to find them.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The list of instance variable on Request objects may be what you<br>
want:<br>
<br>
<a href="http://twistedmatrix.com/documents/current/api/twisted.web.http.Request.html" target="_blank">http://twistedmatrix.com/documents/current/api/twisted.web.http.Request.html</a><br>
<div class="im"><br>
&gt; 4) Are their any wrappers people have developed to make it a bit<br>
&gt; easier to use deferreds (in particular inlinecallbacks) in the<br>
&gt; handlers for twisted.web?  (I am considering just writing a wrapper<br>
&gt; myself that provides an interface similar to google app engine webapp<br>
&gt; [4] but wanted to check first so I don&#39;t reinvent something)<br>
<br>
</div>There&#39;s a branch of Twisted that implements this, hopefully it will<br>
eventually be merged:<br>
<a href="http://twistedmatrix.com/trac/ticket/3711" target="_blank">http://twistedmatrix.com/trac/ticket/3711</a><br>
<br></blockquote><div><br></div><div>Is there anything that is currently holding this up?  (ie. is the design on this branch what will end up in the system or could it change dramatically?)</div><div><br></div><div>Thanks for all the answers.</div>
<div><br></div><div>-Allen</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br>