î
i f! ã @ s� d Z d d l m Z m Z d d l Z d d l Z d d l m Z d d l m
Z
d Z d d d d
g Z d e Z
e
ƒ d e j j ƒ d Z e
d
e Z Gd d „ d e ƒ Z Gd d „ d e ƒ Z Gd d „ d e ƒ Z d d „ Z e e d d
„ Z e d k r}e d d e ƒ Z e j j ƒ Z e d e d d e d d ƒ d d l Z e j d ƒ e j ƒ e j ƒ n d S)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_serverzWSGIServer/ú/ú c @ s" e Z d Z e Z d d „ Z d S)Ú
ServerHandlerc C sB z- | j j | j j d d ƒ d | j ƒ Wd t j | ƒ Xd S)Nr é r )Úrequest_handlerZlog_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_softwarer r r r r r s r c @ sL e Z d Z d Z d Z d d „ Z d d „ Z d d „ Z d d
„ Z d S)r z7BaseHTTPServer that implements the Python WSGI protocolNc C s t j | ƒ | j ƒ d S)z.Override server_bind to store the server name.N)r Úserver_bindÚ
setup_environ)r r r r r 0 s
zWSGIServer.server_bindc C sY i } | _ | j | d