%PDF- %PDF-
Direktori : /opt/alt/python27/lib/python2.7/site-packages/paste/util/ |
Current File : //opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyc |
� |��Wc @ sf d Z d d l Z d d l Z d d l m Z d � Z d e j f d � � YZ d d d d � Z d S( 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_serverc C s? t j d t j t j � � � } t j j d | | f � d S( Ns %Y-%m-%d %H:%M:%Ss [%s] %s ( t timet strftimet localtimet syst stderrt write( t msgt timestamp( ( sF /opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyt debug s t SWAPc B s, e Z d Z d Z d Z d � Z d � Z RS( s` SCGI->WSGI application proxy: let an SCGI server execute WSGI application objects. c O sT | j s t d � � | j d k s0 t d � � | f | } t j j | | � d S( Ns must set app_objs must set prefix( t app_objt AssertionErrort prefixt NoneR t SCGIHandlert __init__( t selft argst kwargs( ( sF /opt/alt/python27/lib/python2.7/site-packages/paste/util/scgiserver.pyR - s c sC | j d � } | j d � } | j | � } | | d <t j | d <d"