U
    	f@                  b   @  sj  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m	Z	m
Z
 d dlZd dlZd dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZm Z  d dl!m"Z"m#Z# e$e%e& Z'e$e%e& Z(e$e%e& Z)e$e%e& Z*e$dd	 e& D Z+e$eZ,d
Z-e.dZ/dddddddZ0ej1ddidej2dddej3de4ddddej3de5dd ddej3d!e4dd"d#ej3d$e5dd%d#ej3d&dd'd(d)ej3d*d+dd,ej6dd-d.ej3d/d0dd1d2ej3d3d4dd5d2ej3d6e7d7dd8d9ej3d:de5d;d<ej3d=e+d>d?ddej3d@e(d>dAddej3dBe)d>dCddej3dDe5dEdFddej3dGe5dHdIddej3dJe7dKdLddej3dMe7dKdNddej3dOe8ddPddej3dQe*d>dRddej3dSe,d>dTddej3dUej6dd-ddVddej3dWej6dd-ddXddej3dYe'ddZddej3d[ddd\d)ej3d]ddd^d)ej3d_ddd`d)ej3dadddbd)ej3dcddddd)ej3dee4ddfd#ej3dge4dhdid#ej3dje5ddkd#ej3dle5dmdnd#ej3doe5ddpd#ej3dqe5drdsddej3dte5ddud#ej3dve4ddwddej3dxe4ddyddej3dze4dd{ddej3d|e5e5ed}ddej3d~e5e5ej9dddej3de4ddddej3de4ddddej3ddddd2ej3dde0d'dddej3ddhdddej3dde5ddd#ej3ddd'dddddddddddddddddddddddddddddddddddddddddddddddddddd0ddZ:ddddd>d>d>dEdHdKdKdd>d>d'dddd7ddedddddddhddmddrddddeej9dddddd'dd.ddddddddddddddddddddddddddddddddddddddddddddddddd0ddZ;e<dkrfe:  dS )    )annotationsN)AnyCallable)ASGIApplication)HTTP_PROTOCOLS
INTERFACESLIFESPAN
LOG_LEVELSLOGGING_CONFIGLOOP_SETUPSSSL_PROTOCOL_VERSIONWS_PROTOCOLSConfigHTTPProtocolTypeInterfaceTypeLifespanTypeLoopSetupTypeWSProtocolType)ServerServerState)ChangeReloadMultiprocessc                 C  s   g | ]}|d kr|qS )none ).0keyr   r   O/var/www/html/apigroqsegura/apigroq/lib/python3.8/site-packages/uvicorn/main.py
<listcomp>&   s      r      uvicorn.errorzclick.Contextzclick.ParameterboolNone)ctxparamvaluereturnc                 C  s@   |r
| j rd S tdjtjt t t	 d | 
  d S )NzKRunning uvicorn {version} with {py_implementation} {py_version} on {system})versionZpy_implementationZ
py_versionsystem)resilient_parsingclickechoformatuvicorn__version__platformZpython_implementationZpython_versionr'   exit)r"   r#   r$   r   r   r   print_version.   s    
r0   auto_envvar_prefixZUVICORN)context_settingsappZUVICORN_APP)envvarz--hostz	127.0.0.1zBind socket to this host.T)typedefaulthelpshow_defaultz--porti@  zABind socket to this port. If 0, an available port will be picked.z--udszBind to a UNIX domain socket.)r5   r6   r7   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagr6   r7   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multipler7   r5   z--reload-includereload_includeszSet glob patterns to include while watching for files. Includes '*.py' by default; these defaults can be overridden with `--reload-exclude`. This option has no effect unless watchfiles is installed.)r<   r7   z--reload-excludereload_excludeszSet glob patterns to exclude while watching for files. Includes '.*, .py[cod], .sw.*, ~*' by default; these defaults can be overridden with `--reload-include`. This option has no effect unless watchfiles is installed.z--reload-delayg      ?zTDelay between previous and next check if application needs to be. Defaults to 0.25s.)r5   r6   r8   r7   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)r6   r5   r7   z--loopautozEvent loop implementation.z--httpzHTTP protocol implementation.z--wsz"WebSocket protocol implementation.z--ws-max-sizei   z#WebSocket max size message in bytesz--ws-max-queue    z2The maximum length of the WebSocket message queue.z--ws-ping-intervalg      4@z#WebSocket ping interval in seconds.z--ws-ping-timeoutz"WebSocket ping timeout in seconds.z--ws-per-message-deflatez)WebSocket per-message-deflate compressionz
--lifespanzLifespan implementation.z--interfacez:Select ASGI3, ASGI2, or WSGI as the application interface.z
--env-filezEnvironment configuration file.z--log-configzBLogging configuration file. Supported formats: .ini, .json, .yaml.z--log-levelzLog level. [default: info]z--access-log/--no-access-logzEnable/Disable access log.z--use-colors/--no-use-colorsz!Enable/Disable colorized logging.z"--proxy-headers/--no-proxy-headerszdEnable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to populate remote address info.z"--server-header/--no-server-headerz%Enable/Disable default Server header.z--date-header/--no-date-headerz#Enable/Disable default Date header.z--forwarded-allow-ipszComma separated list of IPs to trust with proxy headers. Defaults to the $FORWARDED_ALLOW_IPS environment variable if available, or '127.0.0.1'.z--root-path zLSet the ASGI 'root_path' for applications submounted below a given URL path.z--limit-concurrencyz^Maximum number of concurrent connections or tasks to allow, before issuing HTTP 503 responses.z	--backlogi   z0Maximum number of connections to hold in backlogz--limit-max-requestszEMaximum number of requests to service before terminating the process.z--timeout-keep-alive   zLClose Keep-Alive connections if no new data is received within this timeout.z--timeout-graceful-shutdownz8Maximum number of seconds to wait for graceful shutdown.z--ssl-keyfilezSSL key filez--ssl-certfilezSSL certificate filez--ssl-keyfile-passwordzSSL keyfile passwordz--ssl-versionz,SSL version to use (see stdlib ssl module's)z--ssl-cert-reqsz@Whether client certificate is required (see stdlib ssl module's)z--ssl-ca-certszCA certificates filez--ssl-ciphersTLSv1z(Ciphers to use (see stdlib ssl module's)z--headerheaderszASpecify custom default HTTP response headers as a Name:Value pairz	--versionz%Display the uvicorn version and exit.)r9   callbackexpose_valueis_eagerr7   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)r6   r8   r7   z--h11-max-incomplete-event-sizeh11_max_incomplete_event_sizezFFor h11, the maximum number of bytes to buffer of an incomplete event.z	--factoryzFTreat APP as an application factory, i.e. a () -> <ASGI app> callable.)r9   r6   r7   r8   strintr   r   r   floatr   r   z	list[str]z
int | None)0r3   hostportudsfdloophttpwsws_max_sizews_max_queuews_ping_intervalws_ping_timeoutws_per_message_deflatelifespan	interfacereloadr:   r=   r>   reload_delayworkersenv_file
log_config	log_level
access_logproxy_headersserver_headerdate_headerforwarded_allow_ips	root_pathlimit_concurrencybackloglimit_max_requeststimeout_keep_alivetimeout_graceful_shutdownssl_keyfilessl_certfilessl_keyfile_passwordssl_versionssl_cert_reqsssl_ca_certsssl_ciphersrD   
use_colorsapp_dirrH   factoryr%   c/           /   1   C  s   t | |||||||||	|
|||||d kr,tn||||||p<d |pBd |pHd |||||||||| |!|"|#|$|%|&|'|(|)dd |*D |+|.|,|-d/ d S )Nc                 S  s   g | ]}| d dqS ):   )split)r   headerr   r   r   r     s     zmain.<locals>.<listcomp>).rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   r]   r^   r_   r`   rY   rZ   r:   r=   r>   r[   r\   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rD   rr   rt   rs   rH   )runr
   )/r3   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r:   r=   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rD   rr   rs   rH   rt   r   r   r   main<   sf      _rz   ).rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r:   r=   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rD   rr   rs   rt   rH   z*ASGIApplication | Callable[..., Any] | strz
str | Nonez)type[asyncio.Protocol] | HTTPProtocolTypez'type[asyncio.Protocol] | WSProtocolTypezfloat | Nonezlist[str] | str | Nonezstr | os.PathLike[str] | Nonezdict[str, Any] | str | Nonezstr | int | Nonezlist[tuple[str, str]] | Nonezbool | None)0r3   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r:   r=   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rD   rr   rs   rt   rH   r%   c       .   3   0   C  sd  |,d k	rt jd|, t| |||||||||	|
|||||||||||||||||||||| |!|"|#|$|%|&|'|(|)|*|+|-|.d.}/t|/d}0|/js|/jdkrt| tst	
d}1|1d t d |/jr|/ }2t|/|0j|2gd  n4|/jdkr|/ }2t|/|0j|2gd  n|0  |/jr:tj|/jr:t|/j |0js`|/js`|/jdkr`t t d S )Nr   )-rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r:   r=   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rD   rr   rt   rH   )configrv   r   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   rZ   r\   
isinstancerI   logging	getLoggerwarningr/   should_reloadbind_socketr   ry   r   rN   osr;   removestartedSTARTUP_FAILURE)3r3   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r:   r=   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rD   rr   rs   rt   rH   r{   serverloggersockr   r   r   ry     s    20



ry   __main__)=
__future__r   asyncior   r   r.   sslr~   typingr   r   r)   r,   uvicorn._typesr   uvicorn.configr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   Zuvicorn.serverr   r   Zuvicorn.supervisorsr   r   ChoicelistkeysZLEVEL_CHOICESZHTTP_CHOICESZ
WS_CHOICESZLIFESPAN_CHOICESZLOOP_CHOICESZINTERFACE_CHOICESr   r   r   r0   commandargumentoptionrI   rJ   PathrK   r    	CERT_NONErz   ry   __name__r   r   r   r   <module>   s  @


	

gp{
