
    iG              9         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 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  d dl!m"Z" d d	l#m$Z$m%Z%  ej&         e' ej(                                        Z) ej&         e' ej(                                        Z* ej&        e          Z+ddZ,dZ- ej.        d          Z/ddZ0 ej1        ddi           ej2        dd           ej3        de4d d!d"#           ej3        d$e5d%d&d"#           ej3        d'e4dd()           ej3        d*e5dd+)           ej3        d,d"d-d./           ej3        d0d1d"d2 ej6        d"3          4           ej3        d5d6d"d78           ej3        d9d:d"d;8           ej3        d<e7d=d"d>?           ej3        d@de5dAB           ej3        dCe4 e,e          dDdEd"F           ej3        dGe4 e,e          dDdHd"F           ej3        dIe4 e,e           dDdJd"F           ej3        dKe5dLdMd"#           ej3        dNe5dOdPd"#           ej3        dQe7dRdSd"#           ej3        dTe7dRdUd"#           ej3        dVe8d"dWd"#           ej3        dXe*dDdYd"#           ej3        dZe+dDd[d"#           ej3        d\ ej6        d"3          dd]d"#           ej3        d^ ej6        d"3          dd_d"#           ej3        d`e)ddad"#           ej3        dbd"d"dc/           ej3        ddd"dde/           ej3        dfd"d"dg/           ej3        dhd"d"di/           ej3        djd"d"dk/           ej3        dle4ddm)           ej3        dne4dodp)           ej3        dqe5ddr)           ej3        dse5dtdu)           ej3        dve5ddw)           ej3        dxe5d dyd"#           ej3        dze5d{d|d"#           ej3        d}e5dd~)           ej3        de5d{dd"#           ej3        de4ddd"#           ej3        de4ddd"#           ej3        de4ddd"#           ej3        de5 e5e          dd"#           ej3        de5 e5ej9                  dd"#           ej3        de4ddd"#           ej3        de4ddd"#           ej3        ddd"d8           ej3        dd"e0d-d"d           ej3        ddod"d           ej3        dde5dd)           ej3        dd"d-dd"          ddӄ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Z:d d%dddDdDdDdLdOdRdRd"dDdDd-dddd=ddedd"d"d"d"ddoddtdd d{dd{dddeej9        dddddd-ddԜ0ddZ;ddZ<e=dk    r e:             dS dS )    )annotationsN)Callable)RawConfigParser)IOAnyget_args)ASGIApplication)
INTERFACESLIFESPAN
LOG_LEVELSLOGGING_CONFIGSSL_PROTOCOL_VERSIONConfigHTTPProtocolTypeInterfaceTypeLifespanTypeLoopFactoryTypeWSProtocolType)Server)ChangeReloadMultiprocess_typer   returnstrc                b    dd                     d t          |           D                        dS )N[|c              3  &   K   | ]}|d k    |V  dS )noneN ).0keys     I/root/projects/qq-shell/venv/lib/python3.11/site-packages/uvicorn/main.py	<genexpr>z%_metavar_from_type.<locals>.<genexpr>(   s&      HH#------HH    ])joinr   )r   s    r#   _metavar_from_typer(   '   s4    KsxxHHxHHHHHKKKKr%      uvicorn.errorctxclick.Contextparamclick.ParametervalueboolNonec           	        |r| j         rd S t          j        d                    t          j        t          j                    t          j                    t          j	                                         | 
                                 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_versionr6   exit)r+   r-   r/   s      r#   print_versionrA   0   s     C) 	JU\\'&<>>.00?$$	 	] 	
 	
   HHJJJJJr%   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.)rH   rI   rJ   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagrI   rJ   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multiplerJ   rH   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.)rO   rJ   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.)rH   rI   rK   rJ   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)rI   rH   rJ   z--loopautoz"Event loop factory implementation.)rH   metavarrI   rJ   rK   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--limit-max-requests-jitterzuMaximum jitter to add to limit_max_requests. Staggers worker restarts to avoid all workers restarting simultaneously.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.)rL   callbackexpose_valueis_eagerrJ   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)rI   rK   rJ   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.)rL   rI   rJ   rK   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limit_max_requests_jitter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factoryc1                n   t          | fi d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|t          n|d|d|d|d|d|pd d|pd d|p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/|0d0|.d1|/ d S )2Nr]   r^   r`   ra   rb   rd   rf   rh   ri   rj   rl   rm   rn   rt   ru   rv   rw   ro   rp   rM   rP   rQ   rr   rs   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   rX   c                :    g | ]}|                     d d          S ):   )split)r!   headers     r#   
<listcomp>zmain.<locals>.<listcomp>  s&    <<<&c1%%<<<r%   r   r   r   r\   )runr   )1rE   r]   r^   r`   ra   rb   rd   rf   rh   ri   rj   rl   rm   rn   ro   rp   rM   rP   rQ   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   rX   r   r   r\   r   s1                                                    r#   mainr   >   s   f 2 2 2T2 T2 C	2
 22 T2 T2 22  K2 "\2 *)2 (2  652 2 2  &0%7>>Z!2" )#2$ :%2& )'2( v)2*  '4+2, (/4-2. (/4/20 "\122 324 $m526 $m728  K92: 0/;2< )=2> ,+?2@ A2B .-C2D #<";E2F .-G2H #<";I2J $>#=K2L  KM2N "\O2P 21Q2R  KS2T $mU2V "\W2X  KY2Z =<G<<<<[2\ :]2^ _2` a2b 'D&Cc2 2 2 2r%   )0r]   r^   r`   ra   rb   rd   rf   rh   ri   rj   rl   rm   rn   ro   rp   rM   rP   rQ   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   rX   r   r   r   r\   *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       0        ^   |. 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/|/d0|0}1t	          |11          }2|1j        s|1j        d2k    rRt          | t                    s=t          j
        d3          }3|3                    d4           t          j        d2           	 |1j        r?|1                                }4t          |1|2j        |4g5                                           n^|1j        d2k    r?|1                                }4t#          |1|2j        |4g5                                           n|2                                 n# t$          $ r Y nw xY w|1j        r=t(          j                            |1j                  rt)          j        |1j                   nK# |1j        r>t(          j                            |1j                  rt)          j        |1j                   w w w xY w|2j        s-|1j        s(|1j        d2k    rt          j        t0                     d S d S d S d S )6Nr   r]   r^   r`   ra   rb   rd   rf   rh   ri   rj   rl   rm   rn   ro   rp   rM   rP   rQ   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   rX   r   r   r\   )configr   r*   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   rp   rs   
isinstancer   logging	getLoggerwarningr@   should_reloadbind_socketr   r   r   KeyboardInterruptr`   osrN   removestartedSTARTUP_FAILURE)5rE   r]   r^   r`   ra   rb   rd   rf   rh   ri   rj   rl   rm   rn   ro   rp   rM   rP   rQ   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   rX   r   r   r   r\   r   serverloggersocks5                                                        r#   r   r     s   h 7###1 1 1T1 T1 C	1
 21 T1 T1 21  K1 "\1 *)1 (1  651 1 )1  v!1"  K#1$ (%1& ('1( "\)1* +1, -1. :/10 )112 :314 $m516 $m718  K91: 0/;1< )=1> ,+?1@ A1B .-C1D #<";E1F .-G1H #<";I1J $>#=K1L  KM1N "\O1P 21Q1R  KS1T $mU1V "\W1X  KY1Z [1\ :]1^ _1` 'D&Ca1Fd 6"""F !++ZS5I5I+"?33klll" 	%%''D
TFCCCGGIIII^a%%''D
TFCCCGGIIIIJJLLL    : 	""'..44 	"Ifj!!! : 	""'..44 	"Ifj!!!!	" 	" > "&"6 "6>Q;N;N!!!!!" " " ";N;Ns,   0B$G H* 
G"H* !G""H* *AI2namec                    | dk    r"t          j        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   s     r#   __getattr__r   i  s`    }]	
 	
 	
 	/.....
E8EEtEE
F
FFr%   __main__)r   r   r   r   )r+   r,   r-   r.   r/   r0   r   r1   )drE   r   r]   r   r^   r_   r`   r   ra   r_   rb   rc   rd   re   rf   rg   rh   r_   ri   r_   rj   rk   rl   rk   rm   r0   rn   r   ro   r   rp   r0   rM   rq   rP   rq   rQ   rq   rr   rk   rs   r_   rt   r   ru   r   rv   r   rw   r0   rx   r0   ry   r0   rz   r0   r{   r   r|   r   r}   r_   r~   r_   r   r_   r   r_   r   r_   r   r   r   r_   r   r   r   r   r   r   r   r_   r   r_   r   r   r   r   rX   rq   r   r0   r   r   r\   r   r   r0   r   r1   )drE   r   r]   r   r^   r_   r`   r   ra   r   rb   rc   rd   r   rf   r   rh   r_   ri   r_   rj   r   rl   r   rm   r0   rn   r   ro   r   rp   r0   rM   r   rP   r   rQ   r   rr   rk   rs   r   rt   r   ru   r   rv   r   rw   r0   rx   r0   ry   r0   rz   r0   r{   r   r|   r   r}   r   r~   r_   r   r   r   r_   r   r_   r   r   r   r_   r   r   r   r   r   r   r   r_   r   r_   r   r   r   r   rX   r   r   r   r   r   r   r0   r\   r   r   r1   )r   r   r   r   )>
__future__r   asyncior   r   r=   sslr   r   collections.abcr   configparserr   typingr   r   r   r8   r;   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   rA   commandargumentoptionr   r_   Pathrk   r0   	CERT_NONEr   r   r   r   r    r%   r#   <module>r      s   " " " " " "   				  



 



  $ $ $ $ $ $ ( ( ( ( ( ( $ $ $ $ $ $ $ $ $ $   * * * * * *                          " ! ! ! ! ! : : : : : : : :TT/*/"3"344555<]X]__ 5 566  EL,, L L L L 		?	+	+    !5y ABBBm,,,		$   		L   gC4STTTf33^___j$<QRRR	]	4	 	 	    
@	   
	   		_   	
=	   	//	-   	/00	(   
	~..	-   		.   		=   		.   		-   		4   		#   		E   	4	 	 	 	*   	4	 	 	 	M   		%   "	%	   "	,	   (	l	   (	0	   $	.	   	
.	   		W	   		i	   		;	   		P	   !	
P   		d   !		C	   "		V   oCNY]^^^		   		   	C$%%	7   	C	K   		   		3   	L	   	0   
2	   %#		Q   	Q  e e e            _^                                 SR `_ UT   -, CB@
eV "(<B8>%)$(#'#%*..2.2.2JX"&26$(%)%&,0&'1526'++26,0"04e@" @" @" @" @" @"F	G 	G 	G 	G zDFFFFF r%   