ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ ]c@sfdZddlZddlZddlmZdZdejfdYZddddZ dS(sv SCGI-->WSGI application proxy, "SWAP". (Originally written by Titus Brown.) This lets an SCGI front-end like mod_scgi be used to execute WSGI application objects. To use it, subclass the SWAP class like so:: class TestAppHandler(swap.SWAP): def __init__(self, *args, **kwargs): self.prefix = '/canal' self.app_obj = TestAppClass swap.SWAP.__init__(self, *args, **kwargs) where 'TestAppClass' is the application object from WSGI and '/canal' is the prefix for what is served by the SCGI Web-server-side process. Then execute the SCGI handler "as usual" by doing something like this:: scgi_server.SCGIServer(TestAppHandler, port=4000).serve() and point mod_scgi (or whatever your SCGI front end is) at port 4000. Kudos to the WSGI folk for writing a nice PEP & the Quixote folk for writing a nice extensible SCGI server for Python! iN(t scgi_servercCs?tjdtjtj}tjjd||fdS(Ns%Y-%m-%d %H:%M:%Ss[%s] %s (ttimetstrftimet localtimetsyststderrtwrite(tmsgt timestamp((sF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pytdebug s tSWAPcBs,eZdZdZdZdZdZRS(s` SCGI->WSGI application proxy: let an SCGI server execute WSGI application objects. cOsT|jstd|jdk s0td|f|}tjj||dS(Nsmust set app_objsmust set prefix(tapp_objtAssertionErrortprefixtNoneRt SCGIHandlert__init__(tselftargstkwargs((sF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyR-s csC|jd}|jd}|j|}||d} td!| nXdS(%s2 Handle an individual connection. trtws wsgi.inputs wsgi.errorsiis wsgi.versionswsgi.multithreadswsgi.multiprocesss wsgi.run_oncetHTTPStofftont1thttpsswsgi.url_schemethttpt REQUEST_URIt?t SCRIPT_NAMEt PATH_INFOcsj|dS(N(tappend(tdata(tchunks(sF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyRUscs^|r8z%r*|d|d|dnWdd}XnrMtdn||g(S(NiiisHeaders already set!(RR (tstatustresponse_headerstexc_info(t headers_sentt headers_setR(sF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pytstart_responseXs  s500 Server Errors Content-types text/htmlsXXX start_response never calleds Status: %s s%s: %s s Ntcloses,IOError while closing connection ignored: %s(ii(RR(s Content-types text/html(tmakefiletread_envRRtFalsetTruetgetR tlentsplitRR R RthasattrR)tIOErrorR (RtconntinputtoutputtenvironR tpathR(tresultR!R#R$theaderterr((R"R&R'RsF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pythandle_connection3sX         $          N(t__name__t __module__t__doc__RR R RR;(((sF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyR %s  cs}dtffdY}td|}x5dD]-}t|dk r5t|||RRtscgiRR RR RRJ(((sF/opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyts    e