Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/werkzeug/__pycache__/serving.cpython-37.pyc

338 lines
28 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>/<2F>]<5D><><00> @s<>dZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm
Z
ddl m Z dd l mZdd
lmZdd lmZdd lmZy$ddlZdd lmZddlmZWn4ek
r<EFBFBD>ddlZddlmZdd lmZYnXy ddlZWn,ek
<EFBFBD>r*Gdd<10>de<1B>Ze<1C>ZYnXy ddlZWnek
<EFBFBD>rRdZYnXdd<12>ZejZe ed<13>Z!e!<21>rzej"Z"nGdd<15>de<1B>Z"y
ej#Z$Wne%k
<EFBFBD>r<>dZ$YnXdZ&e <00>o<>e ed<17>Z'e<07>r<>ej(Z)ne*Z)Gdd<19>dej+<2B>Z,Gdd<1B>dee<1B>Z-e-Z.d@dd<1D>Z/dAdd<1F>Z0d d!<21>Z1dBd"d#<23>Z2Gd$d%<25>d%e<1B>Z3dCd&d'<27>Z4d(d)<29>Z5d*d+<2B>Z6Gd,d-<2D>d-ee<1B>Z7Gd.d/<2F>d/ee7<65>Z8Gd0d1<64>d1e"e7<65>Z9dDd3d4<64>Z:d5d6<64>Z;dEd9d:<3A>Z<d;d<<3C>Z=d=d><3E>Z>e?d?k<02>r<>e><3E>dS)Fa7
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standard library. If you're using older versions of Python you can
download the package from the cheeseshop.
However there are some caveats. Sourcecode won't reload itself when
changed and each time you kill the server using ``^C`` you get an
`KeyboardInterrupt` error. While the latter is easy to solve the first
one can be a pain in the ass in some situations.
The easiest way is creating a small ``start-myproject.py`` that runs the
application::
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from myproject import make_app
from werkzeug.serving import run_simple
app = make_app(...)
run_simple('localhost', 8080, app, use_reloader=True)
You can also pass it a `extra_files` keyword argument with a list of
additional files (like configuration files) you want to observe.
For bigger applications you should consider using `click`
(http://click.pocoo.org) instead of a simple start file.
:copyright: 2007 Pallets
:license: BSD-3-Clause
<EFBFBD>N<>)<01>PY2)<01>reraise)<01>WIN)<01>wsgi_encoding_dance)<01>_log)<01>InternalServerError)<01>
uri_to_iri)<01> url_parse)<01> url_unquote)<01>BaseHTTPRequestHandler)<01>
HTTPServerc@seZdZdd<02>ZdS)<04> _SslDummycCs td<01><01>dS)NzSSL support unavailable)<01> RuntimeError)<02>self<6C>name<6D>r<00>6/tmp/pip-install-c3kgu56x/Werkzeug/werkzeug/serving.py<70> __getattr__Dsz_SslDummy.__getattr__N)<04>__name__<5F>
__module__<EFBFBD> __qualname__rrrrrrCsrcCs6yddlm}Wntk
r,td<03><01>YnX|SdS)Nr)<01>cryptoz9Using ad-hoc certificates requires the pyOpenSSL library.)<04>OpenSSLr<00> ImportError<6F> TypeError)rrrr<00>_get_openssl_crypto_moduleOs
r<00>forkc@s eZdZdS)<02> ForkingMixInN)rrrrrrrr_sr<00><><00>fromfdc@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>DechunkedInputz8An input stream that handles Transfer-Encoding 'chunked'cCs||_d|_d|_dS)NFr)<03>_rfile<6C>_done<6E>_len)r<00>rfilerrr<00>__init__xszDechunkedInput.__init__cCsdS)NTr)rrrr<00>readable}szDechunkedInput.readablecCsTy"|j<00><01><00>d<01>}t|<01><04>d<02>}Wntk
r>td<03><01>YnX|dkrPtd<05><01>|S)N<>latin1<6E>zInvalid chunk headerrz!Negative chunk length not allowed)r"<00>readline<6E>decode<64>int<6E>strip<69>
ValueError<EFBFBD>IOError)r<00>liner$rrr<00>read_chunk_len<65>szDechunkedInput.read_chunk_lencCs<>d}x<>|js<>|t|<01>kr<>|jdkr,|<00><03>|_|jdkr<d|_|jdkr<>tt|<01>|j<02>}|j<05>|<03>||||<00><|j|8_||7}|jdkr|j<05><07>}|dkrtd<04><01>qW|S)NrT)<03>
s
<EFBFBD> z!Missing chunk terminating newline) r#<00>lenr$r1<00>minr"<00>readr*r/)r<00>bufr6<00>n<>
terminatorrrr<00>readinto<74>s 





 zDechunkedInput.readintoN)rrr<00>__doc__r&r'r1r:rrrrr!us

r!c@s<>eZdZdZedd<03><00>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Z d$d d<0E>Z
dd<10>Z d%dd<12>Z dd<14>Z dd<16>Zdd<18>Zd&dd<1B>Zdd<1D>Zdd<1F>Zd d!<21>Zd"d#<23>Zd S)'<27>WSGIRequestHandlerz3A request handler that implements WSGI dispatching.cCsddlm}d|S)Nr)<01> __version__z Werkzeug/)<02>r=)rr=rrr<00>server_version<6F>s z!WSGIRequestHandler.server_versioncs<>t<00>j<01>}<01>fdd<02>}<02>jjdkr&dnd}<03>js6d<05>_t<05>jt<06>rP<72>jdf<02>_nt|j<01>}d|<03>jt j
<EFBFBD>jj <0B>jj d|<02>j <0A>jd t|<04>t|j<10>t<0F>j<01>t<0F>j<01><01><00><11><00><00><12><00>jjdt<06>jjd
<00><01>jd <0B>}xd<78><00><15>D]X\}}|<06><16><00>d d <0A>}|<07>dd <09>}|dk<07>r&d|}||k<06>r&d<11>|||<07>}|||<q<>W|<05>dd <09><02><1A><00><1B>dk<02>rdd|d<t|d<00>|d<|j<1D>r~|j<1E>r~|j|d<|S)Ncs d<01>j_dS)NT)<02>server<65>shutdown_signalr)rrr<00>shutdown_server<65>sz8WSGIRequestHandler.make_environ.<locals>.shutdown_server<65>http<74>httpsz<local>r)rrFr>r)z wsgi.versionzwsgi.url_schemez
wsgi.inputz wsgi.errorszwsgi.multithreadzwsgi.multiprocessz wsgi.run_oncezwerkzeug.server.shutdown<77>SERVER_SOFTWARE<52>REQUEST_METHODZ SCRIPT_NAMEZ PATH_INFO<46> QUERY_STRINGZ REQUEST_URIZRAW_URI<52> REMOTE_ADDRZ REMOTE_PORTZ SERVER_NAMEZ SERVER_PORTZSERVER_PROTOCOL<4F>-<2D>_z
)<02> CONTENT_TYPE<50>CONTENT_LENGTHZHTTP_z{},{}ZHTTP_TRANSFER_ENCODING<4E>chunkedTzwsgi.input_terminatedz
wsgi.inputZ HTTP_HOST)r
<00>pathr@<00> ssl_context<78>client_address<73>
isinstance<EFBFBD>strr r%<00>sys<79>stderr<72> multithread<61> multiprocessr?<00>commandr<00>query<72>address_string<6E> port_integer<65>server_address<73>request_version<6F>get_header_items<6D>upper<65>replace<63>format<61>getr-<00>lowerr!<00>scheme<6D>netloc)r<00> request_urlrBZ
url_schemeZ path_info<66>environ<6F>key<65>valuer)rr<00> make_environ<6F>sT
  


 

 
zWSGIRequestHandler.make_environc s6<00>j<00>dd<02><02><02><00><03>dkr&<26>j<04>d<04><00><03><06><00>_<07>g<00>g<00><01><00><01><02>fdd<06><08>d<11><01><02>fdd<08> <09><04><00><01><04>fd d
<EFBFBD>}y|<01>jj <09>Wn<>t
t j fk
r<EFBFBD>}z<10><03> |<02><00>Wdd}~XYn|tk
<EFBFBD>r0<00>jjd d lm}|d d<0E>}y<1C>s<><73>dd<00>=|t<12><00>Wntk
<EFBFBD>rYnX<00>j<08>dd|j<14>YnXdS)NZExpectr>z 100-continuesHTTP/1.1 100 Continue
csB<00>s td<01><01><01><01>s<14>\}}<02>dd<00><y|<01>dd<02>\}}Wntk
rX|d}}YnXt|<03>}<03><03>||<04>t<05>}x.|D]&\}}<07><03>||<07>|<06><07>}|<05>|<06>qzWd|kddks<>|dks<>|dks<>d <09>_ <09><03>d
d <0B>d |kr<><72><03>d <0A><03>
<EFBFBD><00>d|k<07>r <0C><03>d<0F><03> <0B><00><00><03> <0C>t |t<0E><02>s(td<10><01><01>j<0F>|<00><00>j<0F><11>dS)Nzwrite() before start_responserr>zcontent-lengthrF<00>HEAD<41><44>)<02><>i0T<>
Connection<EFBFBD>closer@<00>Server<65>date<74>Datezapplications must write bytes)<12>AssertionError<6F>splitr.r,<00> send_response<73>setZ send_headerrb<00>add<64>close_connection<6F>version_stringZdate_time_stringZ end_headersrQ<00>bytes<65>wfile<6C>write<74>flush)<08>data<74>status<75>response_headers<72>code<64>msgZ header_keysrgrh)rf<00> headers_sent<6E> headers_setrrrr{<00>s8     
 z*WSGIRequestHandler.run_wsgi.<locals>.writecs>|rz<10>rt|<02>Wdd}Xn <0C>r*td<01><01>||g<02>dd<00><<00>S)NzHeaders already set)rrr)r~r<00>exc_info)r<>r<>r{rr<00>start_responses z3WSGIRequestHandler.run_wsgi.<locals>.start_responsec sN|<00><00><02>}z&x|D] }<02>|<02>qW<00>s.<2E>d<01>Wdt|d<02>rD|<01><01>d}XdS)N<>rn)<02>hasattrrn)<03>appZapplication_iterr})rfr<>r<>r{rr<00>execute#s

  
z,WSGIRequestHandler.run_wsgi.<locals>.executer)<01>get_current_tracebackT)Zignore_system_exceptions<6E>errorzError on request:
%s)N)<15>headersrarbr-rzr{rirfr@r<><00>_ConnectionError<6F>socket<65>timeout<75>connection_dropped<65> Exception<6F>passthrough_errorsZ debug.tbtoolsr<73>r<00>log<6F> plaintext)rr<><00>er<65><00> tracebackr)rfr<>r<>rr<>r{r<00>run_wsgi<67>s0 !   

zWSGIRequestHandler.run_wsgic
Cs<>d}yt<00>|<00>}Wnhttjfk
rD}z|<00>|<02>Wdd}~XYn8tk
rz}z|jjdksht |<02>sj<73>Wdd}~XYnX|jj
r<EFBFBD>|<00> <0B>|S)z/Handles a request ignoring dropped connections.N) r <00>handler<65>r<>r<>r<>r<>r@rO<00> is_ssl_errorrA<00>initiate_shutdown)r<00>rvr<76>rrrr<>CszWSGIRequestHandler.handlecCs8ttdtj<02>}t<03>r$t<04>t<04><06>|<01>d|j_d|j_ dS)zpA horrible, horrible way to kill the server for Python 2.6 and
later. It's the best we can do.
<20>SIGKILLTFN)
<EFBFBD>getattr<74>signal<61>SIGTERM<52>is_running_from_reloader<65>os<6F>kill<6C>getpidr@<00>_BaseServer__shutdown_requestZ_BaseServer__serving)r<00>sigrrrr<>Qs
z$WSGIRequestHandler.initiate_shutdownNcCsdS)z`Called if the connection was closed by the client. By default
nothing happens.
Nr)rr<>rfrrrr<>_sz%WSGIRequestHandler.connection_droppedcCs.|j<00><01>|_|jsd|_n|<00><04>r*|<00><05>SdS)zHandle a single HTTP request.rN)r%r*Zraw_requestlinerwZ parse_requestr<74>)rrrr<00>handle_one_requestds
 z%WSGIRequestHandler.handle_one_requestcCs^|<00>|<01>|dkr.||jkr*|j|dp,d}|jdkrZd|j||f}|j<04>|<03>d<06><01>dS)z3Send the response header and log the response code.Nrr>zHTTP/0.9z
%s %d %s
<EFBFBD>ascii)<07> log_request<73> responsesr\Zprotocol_versionrzr{<00>encode)rr<><00>message<67>hdrrrrrtls 

z WSGIRequestHandler.send_responsecCst<00>|<00><01><02>S)N)r rxr-)rrrrrxusz!WSGIRequestHandler.version_stringcCs@t|dd<00>r|jdS|js dSt|jt<04>r2|jS|jdSdS)NrfrHz<local>r)r<>rfrPrQrR)rrrrrYxs 
 z!WSGIRequestHandler.address_stringcCs
|jdS)Nr)rP)rrrrrZ<00>szWSGIRequestHandler.port_integerrIcCsy t|j<01>}d|j||jf}Wntk
r:|j}YnXt|<01>}tr<>tj}|ddkrj||dgd<05>}n<>|ddkr<>||dd<08>}nt|d kr<>||d
d<08>}n^|dd kr<>||d d<08>}nD|d kr<>||dd<08>}n.|ddkr<>||ddgd<11>}n||ddgd<11>}|<00> dd|||<02>dS)Nz%s %s %sr<00>1Zbold)<01>attrs<72>2Zwhite)<01>colorZ304Zcyan<61>3ZgreenZ404Zyellow<6F>4Zred)r<>r<>Zmagenta<74>infoz
"%s" %s %s)
r rNrWr\<00>AttributeErrorZ requestlinerR<00> termcolorZcoloredr<64>)rr<><00>sizerNr<>r<>rrrr<><00>s,
     zWSGIRequestHandler.log_requestcGs|jd|<01><02>dS)Nr<4E>)r<>)r<>)r<00>argsrrr<00> log_error<6F>szWSGIRequestHandler.log_errorcGs|jd|f|<02><02>dS)Nr<4E>)r<>)rr`r<>rrr<00> log_message<67>szWSGIRequestHandler.log_messagecGs$t|d|<00><01>|<00><02>||f<00>dS)Nz%s - - [%s] %s
)rrYZlog_date_time_string)r<00>typer<65>r<>rrrr<><00>szWSGIRequestHandler.logc Cs<>tr<>g}x<>|jjD]p}y|dd<02><00>dd<04>\}}Wn<tk
rn|ddkrh|rh|<01><04>\}}||}n<02>YnX|<01>||<04><06>f<02>qWn
|j<01><07>}|S)aV
Get an iterable list of key/value pairs representing headers.
This function provides Python 2/3 compatibility as related to the
parsing of request headers. Python 2.7 is not compliant with
RFC 3875 Section 4.1.18 which requires multiple values for headers
to be provided or RFC 2616 which allows for folding of multi-line
headers. This function will return a matching list regardless
of Python version. It can be removed once Python 2.7 support
is dropped.
:return: List of tuples containing header hey/value pairs
r<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:r)<02> <09> )rr<>rsr.<00>pop<6F>append<6E>lstrip<69>items)rr<><00>headerrgrhrrrr]<00>s 

z#WSGIRequestHandler.get_header_items)N)N)rIrI)rrrr;<00>propertyr?rir<>r<>r<>r<>r<>rtrxrYrZr<>r<>r<>r<>r]rrrrr<<00>s" :U



r<cCs<>ddlm}t<01>}|dkrd}|<02><02>}|<03>t|<01>tj<00><01>|<03>d<01>|<03>d<04>|<03> <09>}||_
d|_ |<03> <0C>}|j
|_
|j |_ |<02> <0A>}|<06>|jd<06>|<03>|<06>|<03>|d<07>||fS)Nr)<01>random<6F>*i<>3<EFBFBD>zDummy Certificatei<00>sha256)r<>rZX509Zset_serial_numberr,rS<00>maxsizeZgmtime_adj_notBeforeZgmtime_adj_notAfterZ get_subjectZCN<43>OZ
get_issuerZPKeyZ generate_keyZTYPE_RSAZ
set_pubkey<EFBFBD>sign)<07>cnr<6E>r<00>cert<72>subjectZissuer<65>pkeyrrr<00>generate_adhoc_ssl_pair<69>s& 


 r<>c Cs<>ddlm}|dk r d||f}t|d<05>\}}|d}|d}t|d<08><02>}|<08>|<03>|j|<04><02>WdQRXt|d<08><02>}|<08>|<03>|j|<05><02>WdQRX||fS) a<>Creates an SSL key for development. This should be used instead of
the ``'adhoc'`` key which generates a new cert on each server start.
It accepts a path for where it should store the key and cert and
either a host or CN. If a host is given it will use the CN
``*.host/CN=host``.
For more information see :func:`run_simple`.
.. versionadded:: 0.9
:param base_path: the path to the certificate and key. The extension
``.crt`` is added for the certificate, ``.key`` is
added for the key.
:param host: the name of the host. This can be used as an alternative
for the `cn`.
:param cn: the `CN` to use.
r)rNz
*.%s/CN=%s)r<>z.crtz.key<65>wb)rrr<><00>openr{<00>dump_certificate<74> FILETYPE_PEM<45>dump_privatekey) <09> base_path<74>hostr<74>rr<>r<><00> cert_file<6C> pkey_file<6C>frrr<00>make_ssl_devcerts    r<>c
Cs<>t<00>}ddl}ddl}t<03>\}}|<01><04>\}}|<01><04>\}}|<02>tj|<08>|<02>tj|<06>t<06>||<00> |j
|<03><02>t<06>||<00> |j
|<04><02>t<06> |<05>t<06> |<07>t ||<08>} | S)z:Generates an adhoc SSL context for the development server.rN)r<00>tempfile<6C>atexitr<74><00>mkstemp<6D>registerr<72><00>remover{r<>r<>r<>rn<00>load_ssl_context)
rr<>r<>r<>r<>Z cert_handler<65>Z pkey_handler<65><00>ctxrrr<00>generate_adhoc_ssl_context(s
  


r<>cCs&|dkrtj}t|<02>}|<03>||<01>|S)a<>Loads SSL context from cert/private key files and optional protocol.
Many parameters are directly taken from the API of
:py:class:`ssl.SSLContext`.
:param cert_file: Path of the certificate to use.
:param pkey_file: Path of the private key to use. If not given, the key
will be obtained from the certificate file.
:param protocol: One of the ``PROTOCOL_*`` constants in the stdlib ``ssl``
module. Defaults to ``PROTOCOL_SSLv23``.
N)<04>ssl<73>PROTOCOL_SSLv23<32> _SSLContext<78>load_cert_chain)r<>r<><00>protocolr<6C>rrrr<><s
 r<>c@s*eZdZdZdd<03>Zd dd<06>Zdd<08>ZdS)
r<EFBFBD>zuA dummy class with a small subset of Python3's ``ssl.SSLContext``, only
intended to be used with and by Werkzeug.cCs||_d|_d|_d|_dS)N)<04> _protocol<6F> _certfile<6C>_keyfile<6C> _password)rr<>rrrr&Ssz_SSLContext.__init__NcCs||_|p ||_||_dS)N)r<>r<>r<>)r<00>certfile<6C>keyfile<6C>passwordrrrr<>Ys
z_SSLContext.load_cert_chaincKs tj|f|j|j|jd<01>|<02><02>S)N)r<>r<><00> ssl_version)r<><00> wrap_socketr<74>r<>r<>)r<00>sock<63>kwargsrrrr<>^s z_SSLContext.wrap_socket)NN)rrrr;r&r<>r<>rrrrr<>Ns
r<>cCsVtjf}yddlm}||f7}Wntk
r6YnX|dkrLt<05><06>d}t||<01>S)z?Checks if the given error (or the current one) is an SSL error.r)<01>ErrorNr)r<><00>SSLErrorZ OpenSSL.SSLr<4C>rrSr<>rQ)r<>Z exc_typesr<73>rrrr<>hs  r<>cCs.|<00>d<01>rtjSd|kr(ttd<03>r(tjStjS)zUReturn ``AF_INET4``, ``AF_INET6``, or ``AF_UNIX`` depending on
the host and port.zunix://r<><00>AF_INET6)<06>
startswithr<EFBFBD><00>AF_UNIXr<58>r<><00>AF_INET)r<><00>portrrr<00>select_address_familyws

r<>cCsZ|tkr|<00>dd<02>dSyt<02>|||tjtj<05>}Wntjk
rL||fSX|ddS)zVReturn a fully qualified socket address that can be passed to
:func:`socket.bind`.z://rr<00>)<07>af_unixrsr<><00> getaddrinfo<66> SOCK_STREAM<41> IPPROTO_TCP<43>gaierror)r<>r<><00>family<6C>resrrr<00> get_sockaddr<64>s
rc@sFeZdZdZdZdZeZddd<05>Zdd<07>Z dd <09>Z
d
d <0B>Z d d <0A>Z dS)<0F>BaseWSGIServerz3Simple single-threaded, single-process WSGI server.FNc Cs>|dkr t}t||<02>|_|dk r6t<03>||jtj<05>}d}t|t|<02>|j<02>} |jtkrht j
<EFBFBD> | <09>rht <09> | <09>t <0A>|| |<04>||_||_d|_||_|j<03><13>d|_|dk r<>|j<03><15>||_|j<03><13>|_|dk <09>r4t|t<18>r<>t|<06>}|dkr<>t<1A>}|j}
t<1B>rt|
tj<03><02>st<03>|
j|
j|
j|
<EFBFBD>}
|j|
dd<06>|_||_ nd|_ dS)NrFrZadhocT)<01> server_side)!r<r<><00>address_familyr<79>r r<>rr,r<>r<>rN<00>exists<74>unlinkr r&r<>r<>rAr<><00> getsocknamer<65>rnr[rQ<00>tupler<65>r<>rrr<><00>protor<6F>rO) rr<>r<>r<><00>handlerr<72>rO<00>fdZ real_sockr[r<>rrrr&<00>s<
 

 

zBaseWSGIServer.__init__cGst||f|<03><02>dS)N)r)rr<>r<>r<>rrrr<><00>szBaseWSGIServer.logcCs>d|_z(yt<01>|<00>Wntk
r*YnXWd|<00><04>XdS)NF)rAr <00> serve_forever<65>KeyboardInterrupt<70> server_close)rrrrr<00>s 
zBaseWSGIServer.serve_forevercCs,|jr<08>tt<02><03>dt<04>rdSt<05>|||<02>S)Nr)r<>rQrSr<>r<>r <00> handle_error)r<00>requestrPrrrr<00>s
zBaseWSGIServer.handle_errorcCs|j<00><01>\}}||fS)N)r<><00>accept)r<00>conr<6E>rrr<00> get_request<73>szBaseWSGIServer.get_request)NFNN) rrrr;rUrV<00> LISTEN_QUEUE<55>request_queue_sizer&r<>rrrrrrrr<00>s
.  rc@seZdZdZdZdZdS)<04>ThreadedWSGIServerz"A WSGI server that does threading.TN)rrrr;rU<00>daemon_threadsrrrrr<00>src@seZdZdZdZddd<07>ZdS) <09>ForkingWSGIServerz A WSGI server that does forking.T<>(NFc
Cs.ts td<01><01>t<02>||||||||<08>||_dS)Nz'Your platform does not support forking.)<05>can_forkr.rr&<00> max_children) rr<>r<>r<><00> processesr r<>rOr rrrr&s
zForkingWSGIServer.__init__)rNFNN)rrrr;rVr&rrrrr<00>srFc
Csj|r|dkrtd<02><01>nP|r0t|||||||d<03>S|dkrPt||||||||d<03>St|||||||d<03>SdS)ztCreate a new server instance that is either threaded, or forks
or just processes one request after another.
rz5cannot have a multithreaded and multi process server.)r N)r.rrr) r<>r<>r<><00>threadedr<00>request_handlerr<72>rOr rrr<00> make_servers" 
r!cCstj<01>d<01>dkS)zwChecks if the application is running from within the Werkzeug
reloader subprocess.
.. versionadded:: 0.10
ZWERKZEUG_RUN_MAIN<49>true)r<>rfrarrrrr<>9sr<>T<>autoc sbt<00>t<01>std<01><01>|r,ddlm}|<0F>|<05><02>| rFddlm}|<10>| <0C><02><00><01>fdd<06><08><02><00><01><02><03><04><05><06><07>f dd<08>}|<03>rXt<07><00>s<<3C>d kr<>ts<>t d
<EFBFBD><01>t
<EFBFBD><01><04>}t <0B><01>|<12>}t <0C> |t j <0A>}|<14>t jt jd<02>|<14>|<13>t|d <0B>r<>|<14>d <0C>t<08>rt|<14><15><00>tjd <|<14>t<19><00>|<14>n*|<14><1A>|tk<02>r<tdd|<00>t<16>|<13>ddlm}|||||<08>n|<11>dS)a<> Start a WSGI application. Optional features include a reloader,
multithreading and fork support.
This function has a command-line interface too::
python -m werkzeug.serving --help
.. versionadded:: 0.5
`static_files` was added to simplify serving of static files as well
as `passthrough_errors`.
.. versionadded:: 0.6
support for SSL was added.
.. versionadded:: 0.8
Added support for automatically loading a SSL context from certificate
file and private key.
.. versionadded:: 0.9
Added command-line interface.
.. versionadded:: 0.10
Improved the reloader and added support for changing the backend
through the `reloader_type` parameter. See :ref:`reloader`
for more information.
.. versionchanged:: 0.15
Bind to a Unix socket by passing a path that starts with
``unix://`` as the ``hostname``.
:param hostname: The host to bind to, for example ``'localhost'``.
If the value is a path that starts with ``unix://`` it will bind
to a Unix socket instead of a TCP socket..
:param port: The port for the server. eg: ``8080``
:param application: the WSGI application to execute
:param use_reloader: should the server automatically restart the python
process if modules were changed?
:param use_debugger: should the werkzeug debugging system be used?
:param use_evalex: should the exception evaluation feature be enabled?
:param extra_files: a list of files the reloader should watch
additionally to the modules. For example configuration
files.
:param reloader_interval: the interval for the reloader in seconds.
:param reloader_type: the type of reloader to use. The default is
auto detection. Valid values are ``'stat'`` and
``'watchdog'``. See :ref:`reloader` for more
information.
:param threaded: should the process handle each request in a separate
thread?
:param processes: if greater than 1 then handle each request in a new process
up to this maximum number of concurrent processes.
:param request_handler: optional parameter that can be used to replace
the default one. You can use this to replace it
with a different
:class:`~BaseHTTPServer.BaseHTTPRequestHandler`
subclass.
:param static_files: a list or dict of paths for static files. This works
exactly like :class:`SharedDataMiddleware`, it's actually
just wrapping the application in that middleware before
serving.
:param passthrough_errors: set this to `True` to disable the error catching.
This means that the server will die on errors but
it can be useful to hook debuggers in (pdb etc.)
:param ssl_context: an SSL context for the connection. Either an
:class:`ssl.SSLContext`, a tuple in the form
``(cert_file, pkey_file)``, the string ``'adhoc'`` if
the server should automatically create one, or ``None``
to disable SSL (which is the default).
zport must be an integerr)<01>DebuggedApplication)<01>SharedDataMiddlewarecsl<00>dkr <0C>nd}d}|jtkr.tdd||<02>n:d|kr>d|}|<00><03>d}tdd <09>dkr\d
nd |||<02>dS) N)r>r<><00> localhostz(Press CTRL+C to quit)r<>z * Running on %s %sr<73>z[%s]rz * Running on %s://%s:%d/ %srCrD)rr<>rr )r<>Zdisplay_hostnameZquit_msgr<67>)<02>hostnamerOrr<00> log_startup<75>s
 zrun_simple.<locals>.log_startupc shyttjd<00>}Wnttfk
r.d}YnXt<05><01><04><00><08><05><06><03>|d<02> }|dkr\<5C>|j<06>|<01><07>dS)N<>WERKZEUG_SERVER_FD)r )r,r<>rf<00> LookupErrorr.r!r<>r)r Zsrv) <09> applicationr'r(r<>r<>rr rOrrr<00>inner<65>s"

zrun_simple.<locals>.innerrzsCannot bind to a random port with enabled reloader if the Python interpreter does not support socket opening by fd.<2E>set_inheritableTr)r<>z Unlinking %s)<01>run_with_reloaderN) rQr,r<00>debugr$Zmiddleware.shared_datar%r<><00>can_open_by_fdr.r<>rr<>r<><00>
setsockopt<EFBFBD>
SOL_SOCKET<EFBFBD> SO_REUSEADDR<44>bindr<64>r-rR<00>filenor<6F>rf<00>listenrrnr<>rr<00> _reloaderr.)r'r<>r+<00> use_reloader<65> use_debuggerZ
use_evalexZ extra_filesZreloader_intervalZ reloader_typerrr Z static_filesr<73>rOr$r%r,rr[<00>sr.r) r+r'r(r<>r<>rr rOrr<00>
run_simpleBsBV
 
 
 
 






 r;cOsddlm}|||<01>S)Nr)r.)r7r.)r<>r<>r.rrrr.<00>s r.c Cs<>ddl}ddlm}|jdd<06>}|jddd d
d <0B>|jd d ddddd<12>|jddddddd<12>|<02><05>\}}d\}}|jr<>|j<06>d<18>}|d}t|<07>dkr<>|d}t|<04>dkr<>t j
<EFBFBD> d<19>t <09> d<03>||d<00>}t |p<>dt|p<>d<1B>||j|jd<1C>dS)z:A simple command-line interface for :py:func:`run_simple`.rNr)<01> import_stringz,Usage: %prog [options] app_module:app_object)<01>usagez-bz--bind<6E>addressz+The hostname:port the app should listen on.)<02>dest<73>helpz-dz--debugr9<00>
store_trueFzUse Werkzeug's debugger.)r?<00>action<6F>defaultr@z-rz--reloadr8z(Reload Python process if modules change.)NNr<4E>z1No application supplied, or too much. See --help
z 127.0.0.1i<EFBFBD>)r'r<>r+r8r9)<11>optparse<73>utilsr<<00> OptionParser<65>
add_option<EFBFBD>
parse_argsr>rsr4rS<00>stdoutr{<00>exitr;r,r8r9) rDr<<00>parser<65>optionsr<73>r'r<>r>r<>rrr<00>main<69>sN       
 
rM<00>__main__)N)NN)NN)N) NNNFrNFNN) FFTNrr#FrNNFN)@r;<00>ior<6F>r<>r<>rS<00>_compatrrrr<00> _internalr<00>
exceptionsr<00>urlsr r
r <00> socketserverZ http.serverr r r<00> SocketServer<65>BaseHTTPServerr<72><00>objectrr<>r<00>ThreadingMixInr<6E>rrr<>r<>r<>rr0r<>r<><00>ConnectionError<6F> RawIOBaser!r<<00>BaseRequestHandlerr<72>r<>r<>r<>r<>r<>r<>rrrrr!r<>r;r.rMrrrrr<00><module>%s<>              
 


5<

#

X
 
%5