ž ¬ÿf!c@sdZddlmZmZddlZddlZddlmZddl m Z dZ ddd d gZ d e Z e ƒd ejjƒdZe d eZGdd„deƒZGdd„deƒZGdd„deƒZdd „Zeedd „Zedkr}eddeƒZejjƒZededdeddƒddlZejdƒejƒej ƒndS(u!BaseHTTPServer that implements the Python WSGI protocol (PEP 3333) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, however, and we strongly recommend that you use a "real" web server for production use. For example usage, see the 'if __name__=="__main__"' block at the end of the module. See also the BaseHTTPServer module docs for other API information. i(uBaseHTTPRequestHandleru HTTPServerN(u SimpleHandler(upython_implementationu0.2u WSGIServeruWSGIRequestHandlerudemo_appu make_serveru WSGIServer/u/u cBs&|EeZdZeZdd„ZdS(u ServerHandlerc CsBz-|jj|jjddƒd|jƒWdtj|ƒXdS(Nu ii(urequest_handleru log_requestustatususplitu bytes_sentu SimpleHandleruclose(uself((u:/opt/alt/python33/lib64/python3.3/wsgiref/simple_server.pyuclose s $uServerHandler.closeN(u__name__u __module__u __qualname__usoftware_versionuserver_softwareuclose(u __locals__((u:/opt/alt/python33/lib64/python3.3/wsgiref/simple_server.pyu ServerHandlersu ServerHandlercBsP|EeZdZdZd Zdd„Zdd„Zdd„Zdd „Z d S( u WSGIServeru7BaseHTTPServer that implements the Python WSGI protocolcCstj|ƒ|jƒdS(u.Override server_bind to store the server name.N(u HTTPServeru server_bindu setup_environ(uself((u:/opt/alt/python33/lib64/python3.3/wsgiref/simple_server.pyu server_bind0s uWSGIServer.server_bindcCsYi}|_|j|d s.   B