Ńň ô†ł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. cCsJ|otdƒ‚n||_|djo"tiiddƒidƒ}n||_d|jo=|djptd||f‚|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?sNYou cannot have '?' in your script name (%r) and also give a query_string (%r)isScript %r not found in path %r(tNotImplementedtscript_filenametNonetostenvirontgettsplittpathtAssertionErrortabspathtexiststjointscriptRtinclude_os_environt query_string(tselft global_confRRRRtpath_dir((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyt__init__!s0   "   "   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: %rR9( R8R@RDRRBR;R9R:Rtlstriptstriptlowertappend(Rtdatatline1R=tvalue((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR7zs6  "     (RRRR7(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR0os R3cBs2eZd„Zd„ZeeƒZdd„ZRS(cCs||_||_dS(N(R#tcontent_length(RR#RL((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.pyR4Ÿs cCsl|ipdS|djo|ii|iƒ}n|iit|i|ƒƒ}|it|ƒ8_|S(NR(RLR R#R6tmintlen(Rtsizettext((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR6Šs  N(RRRR4t classmethodR R6(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR3™s   cCsg}g}d}|io ttdƒ}|io9|iiƒto|i|iƒq‚|iiƒn|djpt ‚|i o|i|i ƒn|djpt ‚|i o|i|i ƒn|djpt ‚xě|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|i iƒdƒ}|djo!|i iƒ|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‚qnXdS(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#tflushtinputRHtcloseR RR$R%R1RRR6tremoveR R7tfilenot_translate_newlinestwaittOSErrorterrno(R?R#R$R%tread_sett write_sett input_bufferttrans_nltrlisttwlisttxlisttnexttnext_lent bytes_writtenRIte((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyR2łsf           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,R1t ImportErrorR t paste.utilRt__all__t ExceptionRtobjectRR0R3R2Ro(((s0/usr/lib/python2.6/site-packages/paste/cgiapp.pyts    W*M