Ńň ô†łKc @sćdZddkZddkZyddkZWnej o dZnXddklZddgZde fd„ƒYZ de fd„ƒYZ de fd „ƒYZ d e fd „ƒYZdddd „Zdddd „ZdS(s% Application that runs a CGI script. i˙˙˙˙N(t converterstCGIErrortCGIApplicationcBseZdZRS(s` Raised when the CGI script can't be found or doesn't act like a proper CGI script. (t__name__t __module__t__doc__(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyRscBs)eZdZdedd„Zd„ZRS(sý This object acts as a proxy to a CGI application. You pass in the script path (``script``), an optional path to search for the script (if the name isn't absolute) (``path``). If you don't give a path, then ``$PATH`` will be used. cCs)|otdƒ‚n||_|djo"tiiddƒidƒ}n||_d|jo|iddƒ\}}ntii|ƒ|jopxv|iD]E}tii tii ||ƒƒotii ||ƒ|_ Pq¤q¤Wt d||ifƒ‚n ||_ ||_ ||_dS(Nsjglobal_conf is no longer supported for CGIApplication (use make_cgi_application); please pass None insteadtPATHtt:t?isScript %r not found in path %r(tNotImplementedtscript_filenametNonetostenvirontgettsplittpathtabspathtexiststjointscriptRtinclude_os_environt query_string(tselft global_confRRRRtpath_dir((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyt__init__!s*   "   "   c Csúd|jo*|iddƒ|iddƒ|dd|ijo-d|ijo"|iiddƒ\}|_n|iiddƒ\}|_|pKt|_|i|i|iƒ|_|i|iƒ|`|`|`Pq.d|jotd|ƒ‚q.|iddƒ\}}|i ƒ}|i ƒ}|i ƒdjo ||_q.|ii ||fƒq.WdS(Ns s iRsBad header line: %rR8( R7R?RCRRAR:R8R9Rtlstriptstriptlowertappend(Rtdatatline1R<tvalue((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR6zs6  "     (RRRR6(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR/os R2cBs2eZd„Zd„ZeeƒZdd„ZRS(cCs||_||_dS(N(R"tcontent_length(RR"RK((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR›s cCs=|idƒ}|ot|ƒ}nd}||d|ƒS(NtCONTENT_LENGTHis wsgi.input(Rtint(tclsRtlength((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR3Ÿs cCsl|ipdS|djo|ii|iƒ}n|iit|i|ƒƒ}|it|ƒ8_|S(NR(RKR R"R5tmintlen(Rtsizettext((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR5Šs  N(RRRR3t classmethodR R5(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR2™s   cCsÚg}g}d}|io ttdƒ}|io9|iiƒto|i|iƒqn|iiƒn|io|i|iƒn|i o|i|i ƒnxě|p|oÝt i ||gƒ\}} } |i| joŁ|d} }dt | ƒ} | o| |i | ƒ7} n| p!|iiƒ|i |iƒqŒti|iiƒ| ƒ} | t | ƒjo| | }qŒn|i|jotti |iiƒdƒ}|djo!|iiƒ|i |iƒn|o|i|ƒ}n|i|ƒn|i |jotti |i iƒdƒ}|djo!|i iƒ|i |i ƒn|o|i|ƒ}n|i|ƒq­q­Wy|iƒWn,tj o }|idjo‚qÖnXdS(sf Run the given process, piping input/output/errors to the given file-like objects (which need not be actual file objects, unlike the arguments passed to Popen). Wait for process to terminate. Note: this is taken from the posix version of subprocess.Popen.communicate, but made more general through the use of file-like objects. Rtnewlinesiii N(tuniversal_newlinesthasattrtopenR"tflushtinputRGtcloseR#R$R0RQR5tremoveR R6tfilenot_translate_newlinestwaittOSErrorterrno(R>R"R#R$tread_sett write_sett input_bufferttrans_nltrlisttwlisttxlisttnexttnext_lent bytes_writtenRHte((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR1łs`           cCs[|djo#|idƒp |idƒ}nti|ƒ}t|d|d|d|ƒS(s9 Paste Deploy interface for :class:`CGIApplication` This object acts as a proxy to a CGI application. You pass in the script path (``script``), an optional path to search for the script (if the name isn't absolute) (``path``). If you don't give a path, then ``$PATH`` will be used. RRRRN(R RRtasboolR(RRRRR((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pytmake_cgi_applications #(RR R+R0t ImportErrorR t paste.utilRt__all__t ExceptionRtobjectRR/R2R1Rn(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyts    W*M