Ñò ‰»&Qc@sfdZddkZddkZddklZd„Zdeifd„ƒYZdddd„Z 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! iÿÿÿÿN(t scgi_servercCs?tidtitiƒƒƒ}tiid||fƒdS(Ns%Y-%m-%d %H:%M:%Ss[%s] %s (ttimetstrftimet localtimetsyststderrtwrite(tmsgt timestamp((s9/usr/lib/python2.6/site-packages/paste/util/scgiserver.pytdebug s tSWAPcBs,eZdZdZdZd„Zd„ZRS(s` SCGI->WSGI application proxy: let an SCGI server execute WSGI application objects. cOsR|ip td‚|idj p td‚|f|}tii||ŽdS(Nsmust set app_objsmust set prefix(tapp_objtAssertionErrortprefixtNoneRt SCGIHandlert__init__(tselftargstkwargs((s9/usr/lib/python2.6/site-packages/paste/util/scgiserver.pyR-s csK|idƒ}|idƒ}|i|ƒ}||dRRtscgiRR RR RRJ(((s9/usr/lib/python2.6/site-packages/paste/util/scgiserver.pyts    e