a
    [gB                  b   @  sz  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	 d dl
mZ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Z0e1dZ2dddddddZ3ej4ddidej5dddej6de7ddddej6de8d d!ddej6d"e7dd#d$ej6d%e8dd&d$ej6d'dd(d)d*ej6d+d,dd-ej9dd.d/ej6d0d1dd2d3ej6d4d5dd6d3ej6d7e:d8dd9d:ej6d;de8d<d=ej6d>e.d?d@ddej6dAe+d?dBddej6dCe,d?dDddej6dEe8dFdGddej6dHe8dIdJddej6dKe:dLdMddej6dNe:dLdOddej6dPe;ddQddej6dRe-d?dSddej6dTe/d?dUddej6dVej9dd.ddWddej6dXej9dd.ddYddej6dZe*dd[ddej6d\ddd]d*ej6d^ddd_d*ej6d`dddad*ej6dbdddcd*ej6ddddded*ej6dfe7ddgd$ej6dhe7didjd$ej6dke8ddld$ej6dme8dndod$ej6dpe8ddqd$ej6dre8dsdtddej6due8ddvd$ej6dwe7ddxddej6dye7ddzddej6d{e7dd|ddej6d}e8e8ed~ddej6de8e8ej<dddej6de7ddddej6de7ddddej6ddddd3ej6dde3d(dddej6ddidddej6dde8ddd$ej6ddd(dddddddddddddddddddddddddddddddddddddddddddddddddddd0ddZ=dd ddd?d?d?dFdIdLdLdd?d?d(dddd8ddedddddddiddnddsddddeej<dddddd(dd.ddddddddddddddddddddddddddddddddddddddddddddddddd0ddZ>e?dkrve=  dS )    )annotationsN)RawConfigParser)IO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   Z/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/uvicorn/main.py
<listcomp>'       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_implementation
py_versionsystem)Zresilient_parsingclickZechoformatuvicorn__version__platformpython_implementationpython_versionr+   exit)r%   r&   r'   r   r   r   print_version/   s    
r4   Zauto_envvar_prefixZUVICORN)Zcontext_settingsappZUVICORN_APP)Z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.)r6   r7   r8   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagr7   r8   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multipler8   r6   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=   r8   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.)r6   r7   r9   r8   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)r7   r6   r8   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 IP Addresses, IP Networks, or literals (e.g. UNIX Socket path) to trust with proxy headers. Defaults to the $FORWARDED_ALLOW_IPS environment variable if available, or '127.0.0.1'. The literal '*' means trust everything.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.)r:   callbackZexpose_valueZis_eagerr8   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)r7   r9   r8   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.)r:   r7   r8   r9   strintr   r   r   floatr   r   z	list[str]z
int | None)0r5   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_ciphersrE   
use_colorsapp_dirrG   factoryr(   c/           /   1   C  s   t | |||||||||	|
|||||d u 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     r    zmain.<locals>.<listcomp>).rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   r\   r]   r^   r_   rX   rY   r;   r>   r?   rZ   r[   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rE   rq   rs   rr   rG   )runr   )/r5   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   r;   r>   r?   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rE   rq   rr   rG   rs   r   r   r   main=   sf      ary   ).rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   r;   r>   r?   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rE   rq   rr   rs   rG   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] | Nonez7dict[str, Any] | str | RawConfigParser | IO[Any] | Nonezstr | int | Nonezlist[tuple[str, str]] | Nonezbool | None)0r5   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   r;   r>   r?   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rE   rq   rr   rs   rG   r(   c       .   3   0   C  s  |,d urt jd|, t| |||||||||	|
|||||||||||||||||||||| |!|"|#|$|%|&|'|(|)|*|+|-|.d.}/t|/d}0|/js|/jdkrt| tst	
d}1|1d t d zz^|/jr|/ }2t|/|0j|2gd  n4|/jdkr|/ }2t|/|0j|2gd  n|0  W n ty0   Y n0 W |/jrtj|/jrt|/j n&|/jr~tj|/jr~t|/j 0 |0js|/js|/jdkrt t d S )Nr   )-rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   r;   r>   r?   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rE   rq   rs   rG   )configru   r"   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   rY   r[   
isinstancerH   logging	getLoggerwarningr3   Zshould_reloadZbind_socketr   rx   r   KeyboardInterruptrM   osr<   removestartedSTARTUP_FAILURE)3r5   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   r;   r>   r?   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rE   rq   rr   rs   rG   rz   serverloggersockr   r   r   rx     s    20



rx   __main__)@
__future__r   asyncior   r   r0   sslr}   configparserr   typingr   r   r   r,   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   r   r   r4   commandargumentoptionrH   rI   PathrJ   r#   	CERT_NONEry   rx   __name__r   r   r   r   <module>   s  @


	

	gp
