a
    3j5E                  d   @  s  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	m
Z
 d dlmZ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 d dl m!Z! d dl"m#Z#m$Z$ e%e&e' Z(e%e&e' Z)e%eZ*d	d
dddZ+dZ,e-dZ.dddddddZ/ej0ddidej1ddd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 d0ej5d d1d2ej2d3d4d d5d6ej2d7d8d d9d6ej2d:e6d;d d<d=ej2d>de4d?d@ej2dAe3e+edBdCd dDej2dEe3e+edBdFd dDej2dGe3e+edBdHd dDej2dIe4dJdKd d!ej2dLe4dMdNd d!ej2dOe6dPdQd d!ej2dRe6dPdSd d!ej2dTe7d dUd d!ej2dVe)dBdWd d!ej2dXe*dBdYd d!ej2dZej5d d1dd[d d!ej2d\ej5d d1dd]d d!ej2d^e(dd_d d!ej2d`d d dad-ej2dbd ddcd-ej2ddd d ded-ej2dfd d dgd-ej2dhd d did-ej2dje3ddkd'ej2dle3dmdnd'ej2doe4ddpd'ej2dqe4drdsd'ej2dte4ddud'ej2dve4dwdxd d!ej2dye4ddzd'ej2d{e4dwd|d d!ej2d}e3dd~d d!ej2de3ddd d!ej2de3ddd d!ej2de4e4edd d!ej2de4e4ej8dd d!ej2de3ddd d!ej2de3ddd d!ej2ddd dd6ej2dd e/d+d ddej2ddmd ddej2dde4ddd'ej2dd d+dd dd
d
dd
dddddddddddddddddd
d
d
ddddd
d
ddddddd
d
d
ddd
d
ddd
dddd1ddZ9dd#dddBdBdBdJdMdPdPd dBdBd+dddd;ddedd d d d ddmddrddwddwdddeej8dddddd+dd/dd
dddddddddddddddddddddddddddd
ddddddddddddd
ddddddd1ddZ:d
d	dddZ;e<dkre9  dS )    )annotationsN)RawConfigParser)IOAnyCallableget_args)ASGIApplication)
INTERFACESLIFESPAN
LOG_LEVELSLOGGING_CONFIGSSL_PROTOCOL_VERSIONConfigHTTPProtocolTypeInterfaceTypeLifespanTypeLoopFactoryTypeWSProtocolType)Server)ChangeReloadMultiprocessr   str)_typereturnc                 C  s    dd dd t| D  dS )N[|c                 s  s   | ]}|d kr|V  qdS )noneN ).0keyr   r   i/www/wwwroot/dpstar/app/297b3aabda72fedb274352021c2dd8b5_venv/lib/python3.9/site-packages/uvicorn/main.py	<genexpr>'       z%_metavar_from_type.<locals>.<genexpr>])joinr   )r   r   r   r    _metavar_from_type&   s    r%      uvicorn.errorzclick.Contextzclick.ParameterboolNone)ctxparamvaluer   c                 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    
r8   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.)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.)rA   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 factory implementation.)r:   metavarr;   r<   r=   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-headerszaEnable/Disable X-Forwarded-Proto, X-Forwarded-For to populate url scheme and 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   zYClose Keep-Alive connections if no new data is received within this timeout (in seconds).z--timeout-graceful-shutdownz8Maximum number of seconds to wait for graceful shutdown.z--timeout-worker-healthcheckzKMaximum number of seconds to wait for a worker to respond to a healthcheck.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_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.)r>   r;   r<   r=   intzLoopFactoryType | strzHTTPProtocolType | strzWSProtocolType | strfloatr   r   z	list[str]z
int | None)1r9   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?   rB   rC   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timeout_worker_healthcheckssl_keyfilessl_certfilessl_keyfile_passwordssl_versionssl_cert_reqsssl_ca_certsssl_ciphersrJ   
use_colorsapp_dirrL   factoryr   c0           0   2   C  s   t | |||||||||	|
|||||d u r,tn||||||p<d |pBd |pHd |||||||||| |!|"|#|$|%|&|'|(|)|*dd |+D |,|/|-|.d0 d S )Nc                 S  s   g | ]}| d dqS ):   )split)r   headerr   r   r    
<listcomp>  r"   zmain.<locals>.<listcomp>)/rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r`   ra   rb   rc   r\   r]   r?   rB   rC   r^   r_   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rJ   rv   rx   rw   rL   )runr   )0r9   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r?   rB   rC   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rJ   rv   rw   rL   rx   r   r   r    main=   sh      lr   )/rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r?   rB   rC   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rJ   rv   rw   rx   rL   z*ASGIApplication | Callable[..., Any] | strz
str | Nonez/type[asyncio.Protocol] | HTTPProtocolType | strz-type[asyncio.Protocol] | WSProtocolType | strz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)1r9   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r?   rB   rC   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rJ   rv   rw   rx   rL   r   c       /   4   1   C  s  |-d urt jd|- t| |||||||||	|
|||||||||||||||||||||| |!|"|#|$|%|&|'|(|)|*|+|,|.|/d/}0t|0d}1|0js|0jdkrt| tst	
d}2|2d t d zz^|0jr|0 }3t|0|1j|3gd  n4|0jdkr|0 }3t|0|1j|3gd  n|1  W n ty2   Y n0 W |0jrtj|0jrt|0j n&|0jrtj|0jrt|0j 0 |1js|0js|0jdkrt t d S )Nr   ).rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r?   rB   rC   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rJ   rv   rx   rL   )configrz   r'   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetZsockets)syspathinsertr   r   r]   r_   
isinstancer   logging	getLoggerwarningr7   Zshould_reloadZbind_socketr   r~   r   KeyboardInterruptrQ   osr@   removestartedSTARTUP_FAILURE)4r9   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r?   rB   rC   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rJ   rv   rw   rx   rL   r   serverloggersockr   r   r    r~     s    31



r~   )namer   c                 C  s<   | dkr$t dt ddlm} |S tdt d|  d S )NServerStatezOuvicorn.main.ServerState is deprecated, use uvicorn.server.ServerState instead.r   )r   zmodule z has no attribute )warningswarnDeprecationWarninguvicorn.serverr   AttributeError__name__)r   r   r   r   r    __getattr__\  s    r   __main__)=
__future__r   Zasyncior   r   r4   sslr   r   configparserr   typingr   r   r   r   r0   r2   Zuvicorn._typesr   Zuvicorn.configr	   r
   r   r   r   r   r   r   r   r   r   r   r   Zuvicorn.supervisorsr   r   ZChoicelistkeysZLEVEL_CHOICESZLIFESPAN_CHOICESZINTERFACE_CHOICESr%   r   r   r   r8   commandargumentoptionr   rM   PathrN   r(   	CERT_NONEr   r~   r   r   r   r   r   r    <module>   s  4


	

	ir 
