o
    Æh5E                  8   @  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*dddZ+dZ,e-dZ.dd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/d0ej2d1d2d#d3ej5d#d4d5ej2d6d7d#d8d9ej2d:d;d#d<d9ej2d=e6d>d#d?d@ej2dAde4dBdCej2dDe3e+edEdFd#dGej2dHe3e+edEdId#dGej2dJe3e+edEdKd#dGej2dLe4dMdNd#d$ej2dOe4dPdQd#d$ej2dRe6dSdTd#d$ej2dUe6dSdVd#d$ej2dWe7d#dXd#d$ej2dYe)dEdZd#d$ej2d[e*dEd\d#d$ej2d]ej5d#d4dd^d#d$ej2d_ej5d#d4dd`d#d$ej2dae(ddbd#d$ej2dcd#d#ddd0ej2ded#ddfd0ej2dgd#d#dhd0ej2did#d#djd0ej2dkd#d#dld0ej2dme3ddnd*ej2doe3dpdqd*ej2dre4ddsd*ej2dte4dudvd*ej2dwe4ddxd*ej2dye4dzd{d#d$ej2d|e4dd}d*ej2d~e4dzdd#d$ej2de3ddd#d$ej2de3ddd#d$ej2de3ddd#d$ej2de4e4edd#d$ej2de4e4ej8dd#d$ej2de3ddd#d$ej2de3ddd#d$ej2ddd#dd9ej2dd#e/d.d#ddej2ddpd#ddej2dde4ddd*ej2dd#d.dd#dddd҄Z9d!d&dddEdEdEdMdPdSdSd#dEdEd.dddd>ddedd#d#d#d#ddpdduddzddzdddeej8dddddd.ddӜ/dddZ:dddZ;e<dkre9  dS 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Multiprocess_typer   returnstrc                 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   N/var/www/html/pro-man-master/venv/lib/python3.10/site-packages/uvicorn/main.py	<genexpr>'   s    z%_metavar_from_type.<locals>.<genexpr>])joinr   )r   r   r   r    _metavar_from_type&   s    r$      uvicorn.errorctxclick.Contextparamclick.ParametervalueboolNonec                 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})versionpy_implementation
py_versionsystem)resilient_parsingclickechoformatuvicorn__version__platformpython_implementationpython_versionr1   exit)r'   r)   r+   r   r   r    print_version/   s   
r<   auto_envvar_prefixUVICORN)context_settingsapp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.)rC   rD   rE   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagrD   rE   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multiplerE   rC   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.)rJ   rE   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.)rC   rD   rF   rE   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)rD   rC   rE   z--loopautoz"Event loop factory implementation.)rC   metavarrD   rE   rF   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.)rG   callbackexpose_valueis_eagerrE   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)rD   rF   rE   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.)rG   rD   rE   rF   hostportintudsfdloopLoopFactoryType | strhttpHTTPProtocolType | strwsWSProtocolType | strws_max_sizews_max_queuews_ping_intervalfloatws_ping_timeoutws_per_message_deflatelifespanr   	interfacer   reload	list[str]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
int | Nonetimeout_worker_healthcheckssl_keyfilessl_certfilessl_keyfile_passwordssl_versionssl_cert_reqsssl_ca_certsssl_ciphers
use_colorsapp_dirfactoryc0           0      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|-d1|. 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|-d1|. d S )2NrX   rY   r[   r\   r]   r_   ra   rc   rd   re   rg   rh   ri   ro   rp   rq   rr   rj   rk   rH   rK   rL   rm   rn   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r~   r   r   r   r   r   r   r   rS   c                 S  s   g | ]}| d dqS ):   )split)r   headerr   r   r    
<listcomp>  s    zmain.<locals>.<listcomp>r   r   r   rW   )runr   )0r@   rX   rY   r[   r\   r]   r_   ra   rc   rd   re   rg   rh   ri   rj   rk   rH   rK   rL   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r~   r   r   r   r   r   r   r   rS   r   r   rW   r   r   r   r    main=   s4    l	
 !"#$%&'()*+,-./0 !"#$%&'()*+,-./0r   )/rX   rY   r[   r\   r]   r_   ra   rc   rd   re   rg   rh   ri   rj   rk   rH   rK   rL   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r~   r   r   r   r   r   r   r   rS   r   r   r   rW   *ASGIApplication | Callable[..., Any] | str
str | None/type[asyncio.Protocol] | HTTPProtocolType | str-type[asyncio.Protocol] | WSProtocolType | strfloat | Nonelist[str] | str | Nonestr | os.PathLike[str] | None7dict[str, Any] | str | RawConfigParser | IO[Any] | Nonestr | int | Nonelist[tuple[str, str]] | Nonebool | Nonec       /   4   	   C  sr  |-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.|.d/|/}0t|0d0}1|0js|0jd1krt| tst	
d2}2|2d3 t d1 zLz.|0jr|0 }3t|0|1j|3gd4  n|0jd1kr|0 }3t|0|1j|3gd4  n|1  W n	 ty   Y nw W |0jrtj|0jrt|0j n|0jrtj|0jrt|0j w w w |1js3|0js5|0jd1kr7t t d S d S d S d S )5Nr   rX   rY   r[   r\   r]   r_   ra   rc   rd   re   rg   rh   ri   rj   rk   rH   rK   rL   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r~   r   r   r   r   r   r   r   rS   r   r   rW   )configr   r&   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   rk   rn   
isinstancer   logging	getLoggerwarningr;   should_reloadbind_socketr   r   r   KeyboardInterruptr[   osrI   removestartedSTARTUP_FAILURE)4r@   rX   rY   r[   r\   r]   r_   ra   rc   rd   re   rg   rh   ri   rj   rk   rH   rK   rL   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r~   r   r   r   r   r   r   r   rS   r   r   r   rW   r   serverloggersockr   r   r    r     s   3	
 !"#$%&'()*+,-./
1



r   namec                 C  s8   | dkrt dt ddlm} |S tdt d|  )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__)r   r   r   r   )r'   r(   r)   r*   r+   r,   r   r-   )br@   r   rX   r   rY   rZ   r[   r   r\   rZ   r]   r^   r_   r`   ra   rb   rc   rZ   rd   rZ   re   rf   rg   rf   rh   r,   ri   r   rj   r   rk   r,   rH   rl   rK   rl   rL   rl   rm   rf   rn   rZ   ro   r   rp   r   rq   r   rr   r,   rs   r,   rt   r,   ru   r,   rv   r   rw   r   rx   rZ   ry   rZ   rz   rZ   r{   rZ   r|   r}   r~   rZ   r   r   r   r   r   r   r   rZ   r   rZ   r   r   r   r   rS   rl   r   r,   r   r   rW   r}   r   r,   r   r-   )br@   r   rX   r   rY   rZ   r[   r   r\   r}   r]   r^   r_   r   ra   r   rc   rZ   rd   rZ   re   r   rg   r   rh   r,   ri   r   rj   r   rk   r,   rH   r   rK   r   rL   r   rm   rf   rn   r}   ro   r   rp   r   rq   r   rr   r,   rs   r,   rt   r,   ru   r,   rv   r   rw   r   rx   r}   ry   rZ   rz   r}   r{   rZ   r|   r}   r~   rZ   r   r   r   r   r   r   r   rZ   r   rZ   r   r   r   r   rS   r   r   r   r   r   r   r,   rW   r}   r   r-   )r   r   r   r   )=
__future__r   asyncior   r   r8   sslr   r   configparserr   typingr   r   r   r   r3   r6   uvicorn._typesr   uvicorn.configr	   r
   r   r   r   r   r   r   r   r   r   r   r   uvicorn.supervisorsr   r   ChoicelistkeysLEVEL_CHOICESLIFESPAN_CHOICESINTERFACE_CHOICESr$   r   r   r   r<   commandargumentoptionr   rZ   Pathrf   r,   	CERT_NONEr   r   r   r   r   r   r   r    <module>   s   4




	

	ni 


