o
    hRC                  7   @  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 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# 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Z2dd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 d0ej9d d1d2ej6d3d4d d5d6ej6d7d8d d9d6ej6d:e:d;d d<d=ej6d>de8d?d@ej6dAe.dBdCd d!ej6dDe+dBdEd d!ej6dFe,dBdGd d!ej6dHe8dIdJd d!ej6dKe8dLdMd d!ej6dNe:dOdPd d!ej6dQe:dOdRd d!ej6dSe;d dTd d!ej6dUe-dBdVd d!ej6dWe/dBdXd d!ej6dYej9d d1ddZd d!ej6d[ej9d d1dd\d d!ej6d]e*dd^d d!ej6d_d d d`d-ej6dad ddbd-ej6dcd d ddd-ej6ded d dfd-ej6dgd d dhd-ej6die7ddjd'ej6dke7dldmd'ej6dne8ddod'ej6dpe8dqdrd'ej6dse8ddtd'ej6due8dvdwd d!ej6dxe8ddyd'ej6dze7dd{d d!ej6d|e7dd}d d!ej6d~e7ddd d!ej6de8e8edd d!ej6de8e8ej<dd d!ej6de7ddd d!ej6de7ddd d!ej6ddd dd6ej6dd e3d+d ddej6ddld ddej6dde8ddd'ej6dd d+dd dddd̄Z=dd#dddBdBdBdIdLdOdOd dBdBd+dddd;ddedd d d d ddlddqddvddddeej<dddddd+dd͜.dddڄZ>dddބZ?e@dkre=  dS 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)ChangeReloadMultiprocessc                 C  s   g | ]}|d kr|qS )none ).0keyr   r   `/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/uvicorn/main.py
<listcomp>(       r      uvicorn.errorctxclick.Contextparamclick.Parametervalueboolreturn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_versionr-   exit)r"   r$   r&   r   r   r   print_version0   s   
r8   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.)r?   r@   rA   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagr@   rA   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multiplerA   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.)rF   rA   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@   rB   rA   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)r@   r?   rA   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.)rC   callbackexpose_valueis_eagerrA   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)r@   rB   rA   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.)rC   r@   rA   rB   strhostportintudsfdloopr   httpr   wsr   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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 )1NrT   rU   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rh   ri   rj   rk   rc   rd   rD   rG   rH   rf   rg   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rw   rx   ry   rz   r{   r|   r}   rN   c                 S  s   g | ]}| d dqS ):   )split)r   headerr   r   r   r     r   zmain.<locals>.<listcomp>r~   r   r   rR   )runr   )/r<   rT   rU   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rc   rd   rD   rG   rH   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rw   rx   ry   rz   r{   r|   r}   rN   r~   r   rR   r   r   r   r   main>   s,    a	
 !"#$%&'()*+,-./ !"#$%&'()*+,-./r   ).rT   rU   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rc   rd   rD   rG   rH   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rw   rx   ry   rz   r{   r|   r}   rN   r~   r   r   rR   *ASGIApplication | Callable[..., Any] | str
str | None)type[asyncio.Protocol] | HTTPProtocolType'type[asyncio.Protocol] | WSProtocolType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       .   3   	   C  sl  |,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 zLz.|/jr|/ }2t|/|0j|2gd3  n|/jd0kr|/ }2t|/|0j|2gd3  n|0  W n	 ty   Y nw W |/jrtj|/jrt|/j n|/jrtj|/jrt|/j w w w |0js0|/js2|/jd0kr4t t d S d S d S d S )4Nr   rT   rU   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rc   rd   rD   rG   rH   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rw   rx   ry   rz   r{   r|   r}   rN   r~   r   rR   )configr   r!   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   rd   rg   
isinstancerS   logging	getLoggerwarningr7   should_reloadbind_socketr   r   r   KeyboardInterruptrW   osrE   removestartedSTARTUP_FAILURE)3r<   rT   rU   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rc   rd   rD   rG   rH   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rw   rx   ry   rz   r{   r|   r}   rN   r~   r   r   rR   r   serverloggersockr   r   r   r     s   2	
 !"#$%&'()*+,-.
0



r   namer   c                 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__O  s   r   __main__)r"   r#   r$   r%   r&   r'   r(   r)   )`r<   rS   rT   rS   rU   rV   rW   rS   rX   rV   rY   r   rZ   r   r[   r   r\   rV   r]   rV   r^   r_   r`   r_   ra   r'   rb   r   rc   r   rd   r'   rD   re   rG   re   rH   re   rf   r_   rg   rV   rh   rS   ri   rS   rj   rS   rk   r'   rl   r'   rm   r'   rn   r'   ro   rS   rp   rS   rq   rV   rr   rV   rs   rV   rt   rV   ru   rv   rw   rS   rx   rS   ry   rS   rz   rV   r{   rV   r|   rS   r}   rS   rN   re   r~   r'   r   rS   rR   rv   r   r'   r(   r)   )`r<   r   rT   rS   rU   rV   rW   r   rX   rv   rY   r   rZ   r   r[   r   r\   rV   r]   rV   r^   r   r`   r   ra   r'   rb   r   rc   r   rd   r'   rD   r   rG   r   rH   r   rf   r_   rg   rv   rh   r   ri   r   rj   r   rk   r'   rl   r'   rm   r'   rn   r'   ro   r   rp   rS   rq   rv   rr   rV   rs   rv   rt   rV   ru   rv   rw   r   rx   r   ry   r   rz   rV   r{   rV   r|   r   r}   rS   rN   r   r~   r   r   r   r   r'   rR   rv   r(   r)   )r   rS   r(   r   )A
__future__r   asyncior   r   r4   sslr   r   configparserr   typingr   r   r   r/   r2   uvicorn._typesr   uvicorn.configr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   uvicorn.supervisorsr   r   ChoicelistkeysLEVEL_CHOICESHTTP_CHOICES
WS_CHOICESLIFESPAN_CHOICESLOOP_CHOICESINTERFACE_CHOICESr   r   r   r8   commandargumentoptionrS   rV   Pathr_   r'   	CERT_NONEr   r   r   r   r   r   r   r   <module>   s   @



	

	lg


