o
    96d+B                     @   s  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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
ej,dej-de.ddfddZ/ej0ddide1dej2de3ddddej2de4ddddej2de3dddej2de4dd dej2d!dd"d#d$ej2d%d&dd'ej5dd(d)ej2d*d+dd,d-ej2d.d/dd0d-ej2d1e6d2dd3d4ej2d5de4d6d7ej2d8e'd9d:ddej2d;e$d9d<ddej2d=e%d9d>ddej2d?e4d@dAddej2dBe4dCdDddej2dEe6dFdGddej2dHe6dFdIddej2dJe.ddKddej2dLe&d9dMddej2dNe(d9dOddej2dPej5dd(ddQddej2dRej5dd(ddSddej2dTe#ddUddej2dVdddWd$ej2dXdddYd$ej2dZddd[d$ej2d\ddd]d$ej2d^ddd_d$ej2d`e3ddadej2dbe3dcdddej2dee4ddfdej2dge4dhdidej2dje4ddkdej2dle4dmdnddej2doe4ddpdej2dqe3ddrddej2dse3ddtddej2due3ddvddej2dwe4e4edxddej2dye4e4ej7dzddej2d{e3dd|ddej2d}e3d~dddej2ddddd-ej2dde/d"dddej2ddcdddej2dde4dddej2ddd"dddde3de3de4de3de4dededede4de4de6de6de.dedede.d&ej8e3 d+ej8e3 d/ej8e3 de6de4de3de3de3de.de.de.de.de3de3de4de4de4de4dej9e4 de3de3de3de4de4de3de3dej8e3 de.de3dej9e4 de.ddf`ddZ:ddddd9d9d9d@dCdFdFdd9d9d"dddd2ddedddddddcddhddmddddeej7dd~dddd"dd.dej;dej<e3f de3de4dej9e3 dej9e4 dedej;ej=e j> ef dej;ej=e j> ef de4de4dej9e6 dej9e6 de.dedede.d&ej9ej;ej8e3 e3f  d+ej9ej;ej8e3 e3f  d/ej9ej;ej8e3 e3f  de6dej9e4 dej9ej;e3ej?f  dej9ej;ej@e3ejAf e3f  dej9ej;e3e4f  de.de.de.de.dej9ej;ej8e3 e3f  de3dej9e4 de4dej9e4 de4dej9e4 dej9e3 dej9ej;e3ej?f  dej9e3 de4de4dej9e3 de3dej9ej8ejBe3e3f   dej9e. dej9e3 de.dej9e4 ddf`ddZCeDdkr@e:  dS dS )    N)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   cC:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\uvicorn/main.py
<listcomp>$       r      uvicorn.errorctxparamvaluereturnc                 C   s>   |r| j rd S tdtjt t t f  | 	  d S )Nz#Running uvicorn %s with %s %s on %s)
Zresilient_parsingclickZechouvicorn__version__platformpython_implementationpython_versionsystemexit)r   r   r    r   r   r   print_version,   s   
	r*   Zauto_envvar_prefixZUVICORN)Zcontext_settingsappz--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.)r,   r-   r.   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagr-   r.   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multipler.   r,   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.)r3   r.   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.)r,   r-   r/   r.   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)r-   r,   r.   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 intervalz--ws-ping-timeoutzWebSocket ping timeoutz--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.)r0   callbackZexpose_valueZis_eagerr.   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)r-   r/   r.   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.)r0   r-   r.   r/   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reload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_ciphers
use_colorsapp_dirfactoryc/           /      C   s  t | fi d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d u r5tn|d|d|d|d|d|pGd d|pLd d|pd d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$d%|%d&|&d'|'d(|(d)|)d*d+d, |*D d-|+d.|.d/|,d0|- d S d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$d%|%d&|&d'|'d(|(d)|)d*d+d, |*D d-|+d.|.d/|,d0|- d S )1Nr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rO   rP   rQ   rR   rK   rL   r1   r4   r5   rM   rN   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   r;   c                 S   s   g | ]}| d dqS ):   )split)r   headerr   r   r   r     r   zmain.<locals>.<listcomp>rd   rf   re   r=   )runr   )/r+   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r1   r4   r5   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   r;   rd   re   r=   rf   r   r   r   main;   s,    g	
 !"#$%&'()*+,-./ !"#$%&'()*+,-./rl   ).r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r1   r4   r5   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   r;   rd   re   rf   r=   r   c       .   3      C   s   |,d urt jd|, t| fi d|d|d|d|d|d|d|d	|d
|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d |d!| d"|!d#|"d$|#d%|$d&|%d'|&d(|'d)|(d*|)d+|*d,|+d-|-d.|.}/t|/d/}0|/js|/jd0krt| tst	
d1}1|1d2 t d0 |/jr|/ }2t|/|0j|2gd3  n|/jd0kr|/ }2t|/|0j|2gd3  n|0  |/jrtj|/jrt|/j |0js
|/js|/jd0krt t d S d S d S d S )4Nr   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r1   r4   r5   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   r;   rd   rf   r=   )configrh   r   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   rL   rN   
isinstancestrlogging	getLoggerwarningr)   Zshould_reloadZbind_socketr   rk   r   r@   osr2   removestartedSTARTUP_FAILURE)3r+   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r1   r4   r5   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   r;   rd   re   rf   r=   rm   serverloggersockr   r   r   rk     s   4	
 !"#$%&'()*+,-.
0


rk   __main__)Easyncioru   rx   r%   sslrp   typingr"   r#   Zuvicorn._typesr   Zuvicorn.configr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   Zuvicorn.serverr   r   Zuvicorn.supervisorsr   r   ZChoicelistkeysZLEVEL_CHOICESZHTTP_CHOICESZ
WS_CHOICESZLIFESPAN_CHOICESZLOOP_CHOICESZINTERFACE_CHOICESr{   rv   r}   Context	Parameterboolr*   commandZargumentoptionrt   intPathfloat	CERT_NONEListOptionalrl   UnionCallableTypeProtocolPathLikeDictAnyTuplerk   __name__r   r   r   r   <module>   sh   @


	


	
 !"#$%&'()*+,-./0lg	
 !"#$%&'()*+,-./0123
 

