î i f!ã@s�dZddlmZmZddlZddlZddlmZddl 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)a!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. é)ÚBaseHTTPRequestHandlerÚ HTTPServerN)Ú SimpleHandler)Úpython_implementationz0.2Ú WSGIServerÚWSGIRequestHandlerÚdemo_appÚ make_serverz WSGIServer/ú/ú c@s"eZdZeZdd„ZdS)Ú ServerHandlerc CsBz-|jj|jjddƒd|jƒWdtj|ƒXdS)Nr ér)Úrequest_handlerZ log_requestZstatusÚsplitZ bytes_sentrÚclose)Úself©rú:/opt/alt/python34/lib64/python3.4/wsgiref/simple_server.pyr s $zServerHandler.closeN)Ú__name__Ú __module__Ú __qualname__Úsoftware_versionZserver_softwarerrrrrr s r c@sLeZdZdZdZdd„Zdd„Zdd„Zd d „ZdS) rz7BaseHTTPServer that implements the Python WSGI protocolNcCstj|ƒ|jƒdS)z.Override server_bind to store the server name.N)rÚ server_bindÚ setup_environ)rrrrr0s zWSGIServer.server_bindcCsYi}|_|j|deZdZdeZdd„Zdd„Zdd„ZdS) rz WSGIServer/cCsÑ|jjjƒ}|j|d<|j|d<|j|d s.   B