
    i)                    L   S SK Jr  S SKrS SKrS SKJrJrJr  S SKJ	r	J
r
Jr  \R                  S:  a  S SKJr  OS SKJr  S SKJrJr  S SKJrJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJ r J!r!  S SK"J#r#J$r$J%r%J&r&J'r'J(r(  S SK)J*r*  \" SSS9r+\" S5      r, " S S5      r-g)    )annotationsN)	AwaitableMappingSequence)AnyCallableTypeVar)   
   )	ParamSpec)StateURLPath)
Middleware_MiddlewareFactory)BaseHTTPMiddleware)ServerErrorMiddleware)ExceptionMiddleware)Request)Response)	BaseRouteRouter)ASGIAppExceptionHandlerLifespanReceiveScopeSend)	WebSocketAppType	Starlette)boundPc                     \ rS rSrSr       S                 SS jjrSS jr\SS j5       rSS jr	SS jr
SS	 jrSSS
 jjrSSS jjr        S S jr      S!S jr      S"S jr   S#           S$S jjr S       S%S jjrS&S jr   S#         S'S jjrSS(S jjrS)S jrSrg)*r       z!Creates an Starlette application.Nc                    Ub  Uc  Ub   S5       eXl         [        5       U l        [        X%XgS9U l        Uc  0 O
[        U5      U l        Uc  / O
[        U5      U l        SU l	        g)a8  Initializes the application.

Parameters:
    debug: Boolean indicating if debug tracebacks should be returned on errors.
    routes: A list of routes to serve incoming HTTP and WebSocket requests.
    middleware: A list of middleware to run for every request. A starlette
        application will always automatically include two middleware classes.
        `ServerErrorMiddleware` is added as the very outermost middleware, to handle
        any uncaught errors occurring anywhere in the entire stack.
        `ExceptionMiddleware` is added as the very innermost middleware, to deal
        with handled exception cases occurring in the routing or endpoints.
    exception_handlers: A mapping of either integer status codes,
        or exception class types onto callables which handle the exceptions.
        Exception handler callables should be of the form
        `handler(request, exc) -> response` and may be either standard functions, or
        async functions.
    on_startup: A list of callables to run on application startup.
        Startup handler callables do not take any arguments, and may be either
        standard functions, or async functions.
    on_shutdown: A list of callables to run on application shutdown.
        Shutdown handler callables do not take any arguments, and may be either
        standard functions, or async functions.
    lifespan: A lifespan context function, which can be used to perform
        startup and shutdown tasks. This is a newer style that replaces the
        `on_startup` and `on_shutdown` handlers. Use one or the other, not both.
Nz>Use either 'lifespan' or 'on_startup'/'on_shutdown', not both.)
on_startupon_shutdownlifespan)
debugr   stater   routerdictexception_handlerslistuser_middlewaremiddleware_stack)selfr)   routes
middlewarer-   r&   r'   r(   s           ^/var/www/html/qgis-automation/mouza_env/lib/python3.13/site-packages/starlette/applications.py__init__Starlette.__init__   st    L J$6;;N 	
L	
O 
W
Vg(:(B"M_H`%/%7rT*=M04    c                F   U R                   nS n0 nU R                  R                  5        H  u  pEUS[        4;   a  UnM  XSU'   M     [	        [
        X!S9/U R                  -   [	        [        X1S9/-   nU R                  n[        U5       H  u  pn
U" U/U	Q70 U
D6nM     U$ )Ni  )handlerr)   )handlersr)   )
r)   r-   items	Exceptionr   r   r/   r   r+   reversed)r1   r)   error_handlerr-   keyvaluer3   appclsargskwargss              r4   build_middleware_stack Starlette.build_middleware_stackP   s    

:<11779JCsI&& %*/3'	 : -}RS""#-8JXYZ 	 kk!)*!5Cvc+D+F+C "6
r7   c                .    U R                   R                  $ N)r+   r2   )r1   s    r4   r2   Starlette.routesf   s    {{!!!r7   c               <    U R                   R                  " U40 UD6$ rH   )r+   url_path_for)r1   namepath_paramss      r4   rK   Starlette.url_path_forj   s    {{''<<<r7   c                   #    XS'   U R                   c  U R                  5       U l         U R                  XU5      I S h  vN   g  N7f)NrA   )r0   rE   )r1   scopereceivesends       r4   __call__Starlette.__call__m   s?     e  ($($?$?$AD!##ED999s   <AAAc                8    U R                   R                  U5      $ rH   )r+   on_event)r1   
event_types     r4   rV   Starlette.on_events   s    {{##J//r7   c                8    U R                   R                  XUS9  g N)rA   rL   )r+   mount)r1   pathrA   rL   s       r4   r[   Starlette.mountv   s    $d3r7   c                8    U R                   R                  XUS9  g rZ   )r+   host)r1   r_   rA   rL   s       r4   r_   Starlette.hosty   s    T2r7   c                    U R                   b  [        S5      eU R                  R                  S[	        U/UQ70 UD65        g )Nz6Cannot add middleware after an application has startedr   )r0   RuntimeErrorr/   insertr   )r1   middleware_classrC   rD   s       r4   add_middlewareStarlette.add_middleware|   sB       ,WXX##Az2B'TT'TV'TUr7   c                     X R                   U'   g rH   )r-   )r1   exc_class_or_status_coder9   s      r4   add_exception_handlerStarlette.add_exception_handler   s    
 =D 89r7   c                :    U R                   R                  X5        g rH   )r+   add_event_handler)r1   rW   funcs      r4   rl   Starlette.add_event_handler   s    
 	%%j7r7   c                :    U R                   R                  XX4US9  g N)methodsrL   include_in_schemar+   	add_route)r1   r\   routerq   rL   rr   s         r4   rt   Starlette.add_route   s     	d7Yjkr7   c                8    U R                   R                  XUS9  g N)rL   r+   add_websocket_route)r1   r\   ru   rL   s       r4   rz   Starlette.add_websocket_route   s     	''$'?r7   c                R   ^ ^ [         R                  " S[        5        SUU 4S jjnU$ )NzThe `exception_handler` decorator is deprecated, and will be removed in version 1.0.0. Refer to https://starlette.dev/exceptions/ for the recommended approach.c                ,   > TR                  TU 5        U $ rH   )ri   )rm   rh   r1   s    r4   	decorator.Starlette.exception_handler.<locals>.decorator   s    &&'?FKr7   rm   r   returnr   warningswarnDeprecationWarning)r1   rh   r~   s   `` r4   exception_handlerStarlette.exception_handler   s*    W	
	 	 r7   c                ^   ^ ^^^^ [         R                  " S[        5        SUUUUU 4S jjnU$ )z
We no longer document this decorator style API, and its usage is discouraged.
Instead you should use the following approach:

>>> routes = [Route(path, endpoint=...), ...]
>>> app = Starlette(routes=routes)
zThe `route` decorator is deprecated, and will be removed in version 1.0.0. Refer to https://starlette.dev/routing/ for the recommended approach.c                B   > TR                   R                  TU TTTS9  U $ rp   rs   )rm   rr   rq   rL   r\   r1   s    r4   r~   "Starlette.route.<locals>.decorator   s0    KK!!"3 "  Kr7   r   r   )r1   r\   rq   rL   rr   r~   s   ````` r4   ru   Starlette.route   s,     	T	
	 	 r7   c                V   ^ ^^ [         R                  " S[        5        SUUU 4S jjnU$ )z
We no longer document this decorator style API, and its usage is discouraged.
Instead you should use the following approach:

>>> routes = [WebSocketRoute(path, endpoint=...), ...]
>>> app = Starlette(routes=routes)
zThe `websocket_route` decorator is deprecated, and will be removed in version 1.0.0. Refer to https://starlette.dev/routing/#websocket-routing for the recommended approach.c                >   > TR                   R                  TU TS9  U $ rx   ry   )rm   rL   r\   r1   s    r4   r~   ,Starlette.websocket_route.<locals>.decorator   s!    KK++D$T+BKr7   r   r   )r1   r\   rL   r~   s   ``` r4   websocket_routeStarlette.websocket_route   s,     	f	
	 	 r7   c                h   ^  [         R                  " S[        5        US:X  d   S5       eSU 4S jjnU$ )z
We no longer document this decorator style API, and its usage is discouraged.
Instead you should use the following approach:

>>> middleware = [Middleware(...), ...]
>>> app = Starlette(middleware=middleware)
zThe `middleware` decorator is deprecated, and will be removed in version 1.0.0. Refer to https://starlette.dev/middleware/#using-middleware for recommended approach.httpz/Currently only middleware("http") is supported.c                0   > TR                  [        U S9  U $ )N)dispatch)re   r   )rm   r1   s    r4   r~   'Starlette.middleware.<locals>.decorator   s     2TBKr7   r   r   )r1   middleware_typer~   s   `  r4   r3   Starlette.middleware   s=     	d	

 &([*[[(	 r7   )r)   r-   r0   r+   r*   r/   )FNNNNNN)r1   r   r)   boolr2   zSequence[BaseRoute] | Noner3   zSequence[Middleware] | Noner-   z%Mapping[Any, ExceptionHandler] | Noner&   "Sequence[Callable[[], Any]] | Noner'   r   r(   zLifespan[AppType] | Noner   None)r   r   )r   zlist[BaseRoute])rL   strrM   r   r   r   )rP   r   rQ   r   rR   r   r   r   )rW   r   r   r   rH   )r\   r   rA   r   rL   
str | Noner   r   )r_   r   rA   r   rL   r   r   r   )rd   z_MiddlewareFactory[P]rC   zP.argsrD   zP.kwargsr   r   )rh   int | type[Exception]r9   r   r   r   )rW   r   rm   r   r   r   )NNT)r\   r   ru   z3Callable[[Request], Awaitable[Response] | Response]rq   list[str] | NonerL   r   rr   r   r   r   )r\   r   ru   z&Callable[[WebSocket], Awaitable[None]]rL   r   r   r   )rh   r   r   r   )
r\   r   rq   r   rL   r   rr   r   r   r   )r\   r   rL   r   r   r   )r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r5   rE   propertyr2   rK   rS   rV   r[   r_   re   ri   rl   rt   rz   r   ru   r   r3   __static_attributes__ r7   r4   r    r       s   + -126DH9=:>-1/5/5/5 +/5 0	/5
 B/5 7/5 8/5 +/5 
/5b, " "=:043V/V V 	V
 
VD"7D "D 
	D88 8 
	8 %)"&ll Cl "	l
 l  l 
l  	@@ 6@ 	@
 
@  %)"& " 	
   
@(r7   ).
__future__r   sysr   collections.abcr   r   r   typingr   r   r	   version_infor   typing_extensionsstarlette.datastructuresr   r   starlette.middlewarer   r   starlette.middleware.baser   starlette.middleware.errorsr   starlette.middleware.exceptionsr   starlette.requestsr   starlette.responsesr   starlette.routingr   r   starlette.typesr   r   r   r   r   r   starlette.websocketsr   r   r"   r    r   r7   r4   <module>r      sp    " 
  8 8 ) )w + 3 ? 8 = ? & ( / U U *
);
/cN^ ^r7   