o
    j                     @  s   U d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ zddlZe ej!ej"fZ#de$d< W n e%y   G dd dZ&e& Ze ej!fZ#Y nw dZ'ej(dkrze)d W n e%y   dZ'Y nw e*edZ+e+rej,Z,nG dd dZ,zej-Z.W n e/y   dZ.Y nw dZ0ej1ej2de3e4ej1e4 f ej5d f  Z6ej7r
ddl8m9Z9 dd l8m:Z: dd!l;m<Z< dd"l=m>Z> G d#d$ d$ej?Z@G d%d& d&eZAdsd+d,ZB	dtdud0d1ZC	dvdwd5d6ZDdxd7d8ZE	dvdyd=d>ZFdtdzdBdCZGd{dGdHZHd|dKdLZId}dMdNZJG dOdP dPeZKG dQdR dRejLeKZMG dSdT dTe,eKZN						d~dd_d`ZOddadbZP							c						dddqdrZQdS )a  A WSGI and HTTP server for use **during development only**. This
server is convenient to use, but is not designed to be particularly
stable, secure, or efficient. Use a dedicate WSGI server and HTTP
server when deploying to production.

It provides features like interactive debugging and code reloading. Use
``run_simple`` to start the server. Put this in a ``run.py`` script:

.. code-block:: python

    from myapp import create_app
    from werkzeug import run_simple
    )annotationsN)datetime)	timedelta)timezone)BaseHTTPRequestHandler)
HTTPServer)unquote)urlsplit   _log)_wsgi_encoding_dance)InternalServerError)parse_set_header)
uri_to_iriztuple[type[Exception], ...]connection_dropped_errorsc                   @  s   e Zd ZdddZdS )		_SslDummynamestrreturnt.Anyc                 C  s   t d)NzUSSL is unavailable because this Python runtime was not compiled with SSL/TLS support.)RuntimeErrorselfr    r   Q/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/werkzeug/serving.py__getattr__2   s   z_SslDummy.__getattr__Nr   r   r   r   )__name__
__module____qualname__r   r   r   r   r   r   1   s    r   TntZcoloramaFforkc                   @  s   e Zd ZdS )ForkingMixInN)r   r   r    r   r   r   r   r#   I   s    r#      ssl.SSLContextadhoc)WSGIApplication)WSGIEnvironment)RSAPrivateKeyWithSerialization)Certificatec                   @  s8   e Zd ZdZdddZdd	d
ZdddZdddZdS )DechunkedInputz8An input stream that handles Transfer-Encoding 'chunked'rfilet.IO[bytes]r   Nonec                 C  s   || _ d| _d| _d S )NFr   )_rfile_done_len)r   r,   r   r   r   __init__d   s   
zDechunkedInput.__init__boolc                 C     dS )NTr   r   r   r   r   readablei   s   zDechunkedInput.readableintc              
   C  sZ   z| j  d}t| d}W n ty" } ztd|d }~ww |dk r+td|S )Nlatin1   zInvalid chunk headerr   z!Negative chunk length not allowed)r/   readlinedecoder7   strip
ValueErrorOSError)r   liner1   er   r   r   read_chunk_lenl   s   
zDechunkedInput.read_chunk_lenbuf	bytearrayc                 C  s  d}| j s|t|k r| jdkr|  | _| jdkrd| _ | jdkrgtt|| j}|| t|krP| jt|| ||d < |  jt|| 8  _t|}n| j||||| < |  j|8  _||7 }| jdkry| j }|dvrytd| j s|t|k s|S )Nr   T)   
   
   z!Missing chunk terminating newline)	r0   lenr1   rA   minr/   readr:   r>   )r   rB   rI   n
terminatorr   r   r   readintov   s*   






$zDechunkedInput.readintoN)r,   r-   r   r.   r   r3   r   r7   )rB   rC   r   r7   )r   r   r    __doc__r2   r6   rA   rL   r   r   r   r   r+   a   s    



r+   c                      s   e Zd ZU dZded< ed7ddZd8d	d
Zd9ddZd9 fddZ		d:d;ddZ
d< fddZd7ddZd=ddZed d! g ed"ed#d$D Zd%eed&< d>d?d+d,Zd@d/d0Zd@d1d2ZdAd5d6Z  ZS )BWSGIRequestHandlerz3A request handler that implements WSGI dispatching.BaseWSGIServerserverr   r   c                 C  s   | j jS N)rR   _server_versionr5   r   r   r   server_version   s   z!WSGIRequestHandler.server_versionr(   c                 C  sH  t | j}| jjd u rdnd}| jsd| _nt| jtr"| jdf| _|js2|jr2d|j |j }n|j}t	|}i ddd|d	| j
d
tjd| jjd| jjddd| jd| jd| jdddt|dt|jdt| jdt| jd|  d|  | jjd t| jjd | jd}| j D ]1\}}d|v rq| dd}|dd}|dvrd | }||v r||  d!| }|||< qd"t|d#v rd$|d%< t|d	 |d	< |jr|jr|j|d&< z| jjd$d'}|d urt !||d(< W |S W |S  t"y   | j#d)d* Y |S  t$y#   Y |S w )+Nhttphttps)<local>r   r   /zwsgi.version)r
   r   zwsgi.url_schemez
wsgi.inputzwsgi.errorszwsgi.multithreadzwsgi.multiprocesszwsgi.run_onceFzwerkzeug.socketZSERVER_SOFTWAREREQUEST_METHODZSCRIPT_NAME Z	PATH_INFOZQUERY_STRINGZREQUEST_URIZRAW_URIREMOTE_ADDRZREMOTE_PORTr
   )ZSERVER_NAMEZSERVER_PORTZSERVER_PROTOCOL_-z
)ZCONTENT_TYPEZCONTENT_LENGTHZHTTP_,chunkedZHTTP_TRANSFER_ENCODINGTzwsgi.input_terminatedZ	HTTP_HOST)binary_formZSSL_CLIENT_CERTerrorz&Cannot fetch SSL peer certificate info)%r	   pathrR   ssl_contextclient_address
isinstancer   schemenetlocr   r,   sysstderrmultithreadmultiprocess
connectionrU   commandr   queryaddress_stringport_integerserver_addressrequest_versionheadersitemsupperreplacer   getr+   getpeercertsslDER_cert_to_PEM_certr=   logAttributeError)r   request_urlZ
url_schemeZ	path_infoenvironkeyvalueZ	peer_certr   r   r   make_environ   s   
	









zWSGIRequestHandler.make_environr.   c                   sr  j dd  dkrjd   _d d d d d d fd
ddfdd	d fdd}z	|jj	 W d S  t
yi } z| W Y d }~d S d }~w ty } zDjjru d ur~ r~d_zd u rd d |t  W n	 ty   Y nw ddlm} || }jdd|  W Y d }~d S d }~ww )NZExpectr[   z100-continues   HTTP/1.1 100 Continue

Fdatabytesr   r.   c                   st  d usJ dd usJ dd u rz
 d d\}}W n ty0   d}}Y nw t|}|| t }D ]\}}|| ||  q@d|v sxd dksxd|  krfdk sxn |d	v sxjd
krxd dd dd 	  t
| tsJ d| r rjtt| dd    jd j|   rjd j  d S )Nzwrite() before start_responser
   r[   zcontent-lengthrZ   HEADd      >   i0     HTTP/1.1TzTransfer-Encodingr`   
Connectionclosezapplications must write bytes   rE   )splitr=   r7   Zsend_responsesetZsend_headeraddlowerprotocol_versionZend_headersrf   r   wfilewritehexrG   encodeflush)r   Zcode_strmsgcodeheader_keysr   r   )chunk_responser   headers_sentheaders_setr   status_sent
status_setr   r   r     sD   

 z*WSGIRequestHandler.run_wsgi.<locals>.writec                   sB   |rz r|d  |d W d }n	d }w rtd| |S )Nr
   r   zHeaders already set)with_tracebackAssertionError)statusrt   exc_info)r   r   r   r   r   r   start_response=  s   z3WSGIRequestHandler.run_wsgi.<locals>.start_responseappr'   c              
     sX  | }z`|D ]}| qsd  rj d W t }|jtj d}d}|jddrUj	d}|t
|7 }|d7 }|rN|dksN|d	krOn|jdds4|  t|d
rd|  d S d S t }|jtj d}d}|jddrj	d}|t
|7 }|d7 }|r|dks|d	krn|jdds||  t|d
r|  w w )N    s   0

r   g{Gz?)timeouti r
   l    d(	 i  r   )r   r   	selectorsDefaultSelectorregisterrm   
EVENT_READselectr,   rI   rG   r   hasattr)r   Zapplication_iterr   selectorZ
total_sizeZtotal_reads)r   r   r   r   r   r   r   r   executeK  sN   




z,WSGIRequestHandler.run_wsgi.<locals>.executeTr
   )DebugTracebackrb   zError on request:
)r   r   r   r.   rS   )r   r'   r   r.   )rt   rx   r   r<   r   r   r   r   rR   r   r   connection_dropped	Exceptionpassthrough_errorsZclose_connectionr   Zdebug.tbtoolsr   Zrender_traceback_textr|   )r   r   r@   r   r   r   )	r   r   r   r   r   r   r   r   r   r   run_wsgi   sD   9'"zWSGIRequestHandler.run_wsgic              
     s   zt    W dS  ttjfy# } z| | W Y d}~dS d}~w tyG } z| jjdur;t	|r;| 
d| n W Y d}~dS d}~ww )z/Handles a request ignoring dropped connections.NzSSL error occurred: %s)superhandleConnectionErrorsocketr   r   r   rR   rd   is_ssl_error	log_error)r   r@   	__class__r   r   r     s   zWSGIRequestHandler.handleNrb   BaseExceptionr   WSGIEnvironment | Nonec                 C  r4   )z`Called if the connection was closed by the client.  By default
        nothing happens.
        Nr   )r   rb   r   r   r   r   r     s    z%WSGIRequestHandler.connection_droppedr   r   c                   s   | dr| jS tt |S )NZdo_)
startswithr   getattrr   r   r   r   r   r     s   
zWSGIRequestHandler.__getattr__c                 C  s*   t | dd r| jd S | jsdS | jd S )Nr   r\   rX   r   )r   r   re   r5   r   r   r   rp     s
   

z!WSGIRequestHandler.address_stringr7   c                 C  s
   | j d S )Nr
   )re   r5   r   r   r   rq     s   
zWSGIRequestHandler.port_integerc                 C  s   i | ]	}|d |dqS )z\x02xr   ).0cr   r   r   
<dictcomp>  s    zWSGIRequestHandler.<dictcomp>          z\\\r^   r   	int | strsizec                 C  s   zt | j}| j d| d| j }W n ty   | j}Y nw || j}t|}|d dkr6t	|d}n8|dkr;n3|dkrEt	|d}n)|d dkrQt	|d	}n|d
kr[t	|d}n|d dkrht	|dd}nt	|dd}| 
dd||| d S )N r   1boldZ200Z304cyan3greenZ404yellow4redmagentainfoz
"%s" %s %s)r   rc   rn   rs   r}   Zrequestline	translate_control_char_tabler   _ansi_styler|   )r   r   r   rc   r   r   r   r   log_request  s,   

zWSGIRequestHandler.log_requestformatargsc                 G     | j d|g|R   d S )Nrb   r|   r   r   r   r   r   r   r        zWSGIRequestHandler.log_errorc                 G  r   )Nr   r   r   r   r   r   log_message  r   zWSGIRequestHandler.log_messagetypemessagec                 G  s<   |   dd}t|| d|   d| dg|R   d S )N%z%%z - - [z] 
)rp   rw   r   Zlog_date_time_string)r   r   r   r   rp   r   r   r   r|     s   zWSGIRequestHandler.log)r   r   )r   r(   r   r.   rS   )rb   r   r   r   r   r.   r   rN   )r^   r^   )r   r   r   r   r   r.   )r   r   r   r   r   r.   r   r   r   r   r   r   r   r.   )r   r   r    rO   __annotations__propertyrU   r   r   r   r   r   rp   rq   r   	maketransranger   ordr   r   r   r|   __classcell__r   r   r   r   rP      s,   
 

Q 

	

rP   r   r   stylesr   c                 G  sB   t s| S ddddddd}|D ]}d||  d	|  } q|  d
S )Nr
      r   !   #   $   )r   r   r   r   r   r   z[mz[0m)_log_add_style)r   r   codesstyler   r   r   r     s   	
r   cn
str | None2tuple[Certificate, RSAPrivateKeyWithSerialization]c           
      C  sB  z ddl m} ddlm} ddlm} ddlm} ddlm	} W n t
y,   tdd w | }|jdd	|d
}| d u r>d} |||jd||j| g}| }| ||| | ttjttjtdd j||j gddj|!|"| |"d|  gdd#||$ |}	|	|fS )Nr   )x509)default_backend)hashes)rsa)NameOIDz<Using ad-hoc certificates requires the cryptography library.i  i   )Zpublic_exponentZkey_sizebackend*zDummy Certificateim  )daysF)criticalz*.)%Zcryptographyr   Zcryptography.hazmat.backendsr   cryptography.hazmat.primitivesr   Z)cryptography.hazmat.primitives.asymmetricr   Zcryptography.x509.oidr   ImportError	TypeErrorZgenerate_private_keyNameZNameAttributeZORGANIZATION_NAMEZCOMMON_NAMEZCertificateBuilderZsubject_nameZissuer_nameZ
public_keyZserial_numberZrandom_serial_numberZnot_valid_beforedtnowr   utcZnot_valid_afterr   add_extensionZExtendedKeyUsageZOID_SERVER_AUTHZSubjectAlternativeNameZDNSNamesignSHA256)
r   r   r   r   r   r   r   pkeysubjectcertr   r   r   generate_adhoc_ssl_pair  sR   

r  	base_pathhosttuple[str, str]c           	      C  s   |dur|}t |d\}}ddlm} |  d}|  d}t|d}|||jj W d   n1 s7w   Y  t|d}||j|jj|j	j
| d W d   ||fS 1 s`w   Y  ||fS )	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.
    N)r   r   serializationz.crtz.keywbencodingr   Zencryption_algorithm)r  r  r  openr   public_bytesEncodingPEMprivate_bytesPrivateFormatTraditionalOpenSSLNoEncryption)	r  r  r   r  r  r  	cert_file	pkey_filefr   r   r   make_ssl_devcert*  s*   


		r"  c            
      C  s   ddl } ddl}t \}}ddlm} | \}}| \}}| tj| | tj| t	||
|jj t	||j|jj|jj| d t| t| t||}	|	S )z:Generates an adhoc SSL context for the development server.r   Nr  r  )atexittempfiler  r  r  mkstempr   osremover   r  r  r  r  r  r  r  r   load_ssl_context)
r#  r$  r  r  r  Zcert_handler  Zpkey_handler   ctxr   r   r   generate_adhoc_ssl_contextV  s*   

	

r*  r  r   protocol
int | Nonec                 C  s(   |du rt j}t |}|| | |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: A ``PROTOCOL`` constant from the :mod:`ssl` module.
        Defaults to :data:`ssl.PROTOCOL_TLS_SERVER`.
    N)rz   PROTOCOL_TLS_SERVER
SSLContextload_cert_chain)r  r   r+  r)  r   r   r   r(  t  s
   
r(  rb   Exception | Noner3   c                 C  s(   | du rt tt d } t| tjS )z?Checks if the given error (or the current one) is an SSL error.Nr
   )tcastr   ri   r   rf   rz   SSLError)rb   r   r   r   r     s   r   portr7   socket.AddressFamilyc                 C  s.   |  drtjS d| v rttdrtjS tjS )zUReturn ``AF_INET4``, ``AF_INET6``, or ``AF_UNIX`` depending on
    the host and port.zunix://:AF_INET6)r   r   AF_UNIXr   r7  AF_INET)r  r4  r   r   r   select_address_family  s
   
r:  familytuple[str, int] | strc                 C  sb   |t krtj| dd S zt| ||tjtj}W n tj	y*   | |f Y S w |d d S )zVReturn a fully qualified socket address that can be passed to
    :func:`socket.bind`.://r   r      )
af_unixr&  rc   abspath	partitionr   getaddrinfoSOCK_STREAMIPPROTO_TCPgaierror)r  r4  r;  resr   r   r   get_sockaddr  s   rG  c              	   C  s   | t jkrdnd}t  | t j1}z	||df W n ty3   | t jkr(dnd Y W  d   S w | d W  d   S 1 sDw   Y  dS )zGet the IP address of an external interface. Used when binding to
    0.0.0.0 or ::1 to show a more useful URL.

    :meta private:
    zfd31:f903:5ab5:1::1z10.253.155.219i2  z::1	127.0.0.1Nr   )r   r7  
SOCK_DGRAMconnectr>   getsockname)r;  r  sr   r   r   get_interface_ip  s   
$rM  c                      sn   e Zd ZdZdZdZeZdZ				d)d* fddZ	d+ddZ
d,d- fd d!Zd. fd%d&Zd/d'd(Z  ZS )0rQ   zuA WSGI server that that handles one request at a time.

    Use :func:`make_server` to create a server instance.
    FTNr  r   r4  r7   r   r'   handlertype[WSGIRequestHandler] | Noner   r3   rd   _TSSLContextArg | Nonefdr,  r   r.   c              
     s  |d u rt }dt|vr| js| jrd|_|| _|| _|| _|| _t	|| | _
}t|t||}	|tkrJ|d u rJtt|	}	tj|	rJt|	 t j|	|dd |d u rz
|   |   W nb ty }
 z8|   t|
jtjd |
jtj krtd| dtjd tj!dkr|d	krtd
tjd t"d W Y d }
~
n#d }
~
w t#y   |    w |   t$%||t$j&| _$| j$' | _(|tkr| j(d | _|d urt)|t*rt+| }n|dkrt, }|j-| j$dd| _$|| _.nd | _.dd l/}d|j01d | _2d S )Nr   r   F)bind_and_activate)filezPort zp is in use by another program. Either identify and stop that program, or start the server with a different port.darwini  zPOn macOS, try searching for and disabling 'AirPlay Receiver' in System Settings.r
   r&   T)server_sider   z	Werkzeug/Zwerkzeug)3rP   varsrk   rl   r   r  r4  r   r   r:  address_familyrG  r7   r?  r1  r2  r   r&  rc   existsunlinkr   r2   server_bindserver_activater>   server_closeprintstrerrorri   rj   errnoZ
EADDRINUSEplatformexitr   r   fromfdrC  rK  rr   rf   tupler(  r*  wrap_socketrd   importlib.metadatametadataversionrT   )r   r  r4  r   rN  r   rd   rQ  rW  rr   r@   	importlibr   r   r   r2     sz   




zBaseWSGIServer.__init__r   r   r   r   c                 G  s   t ||g|R   d S rS   r   )r   r   r   r   r   r   r   r|   /  s   zBaseWSGIServer.log      ?poll_intervalfloatc                   sN   z!z	t  j|d W n	 ty   Y nw W |   d S W |   d S |   w )N)rj  )r   serve_foreverKeyboardInterruptr\  )r   rj  r   r   r   rl  2  s   zBaseWSGIServer.serve_foreverrequestre   r<  c                   s   | j r t ||S rS   )r   r   handle_error)r   rn  re   r   r   r   ro  :  s   zBaseWSGIServer.handle_errorc                 C  s   d}t |dd}|g}| jtkr|d| j  nW| jdu r!dnd}| j}| jdv rX|d	| j d
 | jdkrBd}ttj}nd}ttj	}|d| d| d| j
  d|v rbd| d}|d| d| d| j
  tdd| dS )z<Show information about the address when starting the server.zvWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.r   r   z * Running on NrV   rW   >   z::0.0.0.0z * Running on all addresses ()rp  rH  z[::1]r=  r6  []r   r   )r   rW  r?  appendr  rd   rM  r   r9  r7  r4  r   join)r   Zdev_warningmessagesrg   Zdisplay_hostname	localhostr   r   r   log_startupB  s(   



zBaseWSGIServer.log_startup)NFNN)r  r   r4  r7   r   r'   rN  rO  r   r3   rd   rP  rQ  r,  r   r.   r   )ri  )rj  rk  r   r.   )rn  r   re   r<  r   r.   r   )r   r   r    rO   rk   rl   LISTEN_QUEUErequest_queue_sizeallow_reuse_addressr2   r|   rl  ro  rx  r   r   r   r   r   rQ     s    
grQ   c                   @  s   e Zd ZdZdZdZdS )ThreadedWSGIServerzA WSGI server that handles concurrent requests in separate
    threads.

    Use :func:`make_server` to create a server instance.
    TN)r   r   r    rO   rk   daemon_threadsr   r   r   r   r|  e  s    r|  c                      s2   e Zd ZdZdZ					dd fddZ  ZS )ForkingWSGIServerzA WSGI server that handles concurrent requests in separate forked
    processes.

    Use :func:`make_server` to create a server instance.
    T(   NFr  r   r4  r7   r   r'   	processesrN  rO  r   r3   rd   rP  rQ  r,  r   r.   c	           	   	     s.   t stdt ||||||| || _d S )Nz'Your platform does not support forking.)can_forkr=   r   r2   max_children)	r   r  r4  r   r  rN  r   rd   rQ  r   r   r   r2   y  s   
zForkingWSGIServer.__init__)r  NFNN)r  r   r4  r7   r   r'   r  r7   rN  rO  r   r3   rd   rP  rQ  r,  r   r.   )r   r   r    rO   rl   r2   r   r   r   r   r   r~  p  s    r~  r   r'   threadedr  request_handlerrO  r   rd   rP  rQ  c	           	   
   C  sd   |r
|dkr
t d|rt| ||||||dS |dkr't| |||||||dS t| ||||||dS )a6  Create an appropriate WSGI server instance based on the value of
    ``threaded`` and ``processes``.

    This is called from :func:`run_simple`, but can be used separately
    to have access to the server object, such as to run it in a separate
    thread.

    See :func:`run_simple` for parameter docs.
    r
   z4Cannot have a multi-thread and multi-process server.rQ  )r=   r|  r~  rQ   )	r  r4  r   r  r  r  r   rd   rQ  r   r   r   make_server  s(   r  c                   C  s   t jddkS )zqCheck if the server is running as a subprocess within the
    Werkzeug reloader.

    .. versionadded:: 0.10
    ZWERKZEUG_RUN_MAINtrue)r&  r   rx   r   r   r   r   is_running_from_reloader  s   r  autohostnameapplicationuse_reloaderuse_debugger
use_evalexextra_filest.Iterable[str] | Noneexclude_patternsreloader_intervalreloader_typestatic_files'dict[str, str | tuple[str, str]] | Noner.   c                 C  s  t |ts	td|rddlm} |||}|r*ddlm} |||d}|j|  t	 s0d}ntt
jd }t| |||
|||||d	}|jd	 t| t
jd< t	 sb|  td
tdd |rddlm} z||j||||	d W |  dS |  w |  dS )a  Start a development server for a WSGI application. Various
    optional features can be enabled.

    .. warning::

        Do not use the development server when deploying to production.
        It is intended for use only during local development. It is not
        designed to be particularly efficient, stable, or secure.

    :param hostname: The host to bind to, for example ``'localhost'``.
        Can be a domain, IPv4 or IPv6 address, or file path starting
        with ``unix://`` for a Unix socket.
    :param port: The port to bind to, for example ``8080``. Using ``0``
        tells the OS to pick a random free port.
    :param application: The WSGI application to run.
    :param use_reloader: Use a reloader process to restart the server
        process when files are changed.
    :param use_debugger: Use Werkzeug's debugger, which will show
        formatted tracebacks on unhandled exceptions.
    :param use_evalex: Make the debugger interactive. A Python terminal
        can be opened for any frame in the traceback. Some protection is
        provided by requiring a PIN, but this should never be enabled
        on a publicly visible server.
    :param extra_files: The reloader will watch these files for changes
        in addition to Python modules. For example, watch a
        configuration file.
    :param exclude_patterns: The reloader will ignore changes to any
        files matching these :mod:`fnmatch` patterns. For example,
        ignore cache files.
    :param reloader_interval: How often the reloader tries to check for
        changes.
    :param reloader_type: The reloader to use. The ``'stat'`` reloader
        is built in, but may require significant CPU to watch files. The
        ``'watchdog'`` reloader is much more efficient but requires
        installing the ``watchdog`` package first.
    :param threaded: Handle concurrent requests using threads. Cannot be
        used with ``processes``.
    :param processes: Handle concurrent requests using up to this number
        of processes. Cannot be used with ``threaded``.
    :param request_handler: Use a different
        :class:`~BaseHTTPServer.BaseHTTPRequestHandler` subclass to
        handle requests.
    :param static_files: A dict mapping URL prefixes to directories to
        serve static files from using
        :class:`~werkzeug.middleware.SharedDataMiddleware`.
    :param passthrough_errors: Don't catch unhandled exceptions at the
        server level, let the server crash instead. If ``use_debugger``
        is enabled, the debugger will still catch such errors.
    :param ssl_context: Configure TLS to serve over HTTPS. Can be an
        :class:`ssl.SSLContext` object, a ``(cert_file, key_file)``
        tuple to create a typical context, or the string ``'adhoc'`` to
        generate a temporary self-signed certificate.

    .. versionchanged:: 2.1
        Instructions are shown for dealing with an "address already in
        use" error.

    .. versionchanged:: 2.1
        Running on ``0.0.0.0`` or ``::`` shows the loopback IP in
        addition to a real IP.

    .. versionchanged:: 2.1
        The command-line interface was removed.

    .. versionchanged:: 2.0
        Running on ``0.0.0.0`` or ``::`` shows a real IP address that
        was bound as well as a warning not to run the development server
        in production.

    .. versionchanged:: 2.0
        The ``exclude_patterns`` parameter was added.

    .. versionchanged:: 0.15
        Bind to a Unix socket by passing a ``hostname`` that starts with
        ``unix://``.

    .. versionchanged:: 0.10
        Improved the reloader and added support for changing the backend
        through the ``reloader_type`` parameter.

    .. versionchanged:: 0.9
        A command-line interface was added.

    .. versionchanged:: 0.8
        ``ssl_context`` can be a tuple of paths to the certificate and
        private key files.

    .. versionchanged:: 0.6
        The ``ssl_context`` parameter was added.

    .. versionchanged:: 0.5
       The ``static_files`` and ``passthrough_errors`` parameters were
       added.
    zport must be an integerr
   )SharedDataMiddleware)DebuggedApplication)ZevalexNZWERKZEUG_SERVER_FDr  Tr   zPress CTRL+C to quitr   )run_with_reloader)r  r  intervalr  )rf   r7   r  Zmiddleware.shared_datar  debugr  trusted_hostsrt  r  r&  r   r  r   set_inheritabler   filenorx  r   r   Z	_reloaderr  rl  r\  )r  r4  r  r  r  r  r  r  r  r  r  r  r  r  r   rd   r  r  rQ  Zsrvr  r   r   r   
run_simple  sP   
p
r  )r   r   r   r   r   r   rS   )r   r   r   r   )NN)r  r   r  r   r   r   r   r  )r   r%   )r  r   r   r   r+  r,  r   r%   )rb   r0  r   r3   )r  r   r4  r7   r   r5  )r  r   r4  r7   r;  r5  r   r<  )r;  r5  r   r   )Fr
   NFNN)r  r   r4  r7   r   r'   r  r3   r  r7   r  rO  r   r3   rd   rP  rQ  r,  r   rQ   rM   )FFTNNr
   r  Fr
   NNFN)"r  r   r4  r7   r  r'   r  r3   r  r3   r  r3   r  r  r  r  r  r7   r  r   r  r3   r  r7   r  rO  r  r  r   r3   rd   rP  r   r.   )RrO   
__future__r   r_  ior&  r   r   socketserverri   typingr1  r   r  r   r   Zhttp.serverr   r   urllib.parser   r	   	_internalr   r   
exceptionsr   rV   r   urlsr   rz   r   r   SSLEOFErrorr   r   r  r   r   r   
__import__r   r  r#   r8  r?  r}   ry  OptionalUnionrc  r   LiteralZ_TSSLContextArgTYPE_CHECKINGZ_typeshed.wsgir'   r(   Z-cryptography.hazmat.primitives.asymmetric.rsar)   Zcryptography.x509r*   	RawIOBaser+   rP   r   r  r"  r*  r(  r   r:  rG  rM  rQ   ThreadingMixInr|  r~  r  r  r  r   r   r   r   <module>   s    


">  
I2
,



 )
-