
    F/jp                        d dl Z d dlZd dlZd dlmZmZ d dlmZmZm	Z	m
Z
mZmZ d dlmZmZmZ d dlmZ d dlmZmZmZ d dlmZ d dlmZ d	d
lmZ d	dlmZ erd	dlm Z  d	dl!m"Z" d	dl#m$Z$m%Z% d	dl&m'Z' n
exZ$xZ%xZ Z'eZ" G d de      Z( G d de      Z) G d de      Z* G d de      Z+ G d de      Z,er	e
ee-      Z.ne
Z.edge/f   Z0 G d dee.      Z1 G d de      Z2 G d d e      Z3y)!    N)ABCabstractmethod)	AwaitableCallable	GeneratorIterableSequenceSized)
BaseCookieMorselSimpleCookie)MappingProxyType)TYPE_CHECKINGAny	TypedDict)CIMultiDict)URL   )parse_set_cookie_headers)LooseCookies)Application)HTTPException)BaseRequestRequest)StreamResponsec                   \    e Zd ZddZdeddfdZedefd       ZddZ	e
dedd	fd
       Zy)AbstractRouterreturnNc                     d| _         y )NF_frozenselfs    I/var/www/html/maxservice/venv/lib/python3.12/site-packages/aiohttp/abc.py__init__zAbstractRouter.__init__   s	        appc                      y)zPost init stage.

        Not an abstract method for sake of backward compatibility,
        but if the router wants to be aware of the application
        it can override this.
        N r#   r'   s     r$   	post_initzAbstractRouter.post_init       r&   c                     | j                   S Nr    r"   s    r$   frozenzAbstractRouter.frozen&   s    ||r&   c                     d| _         y)zFreeze router.TNr    r"   s    r$   freezezAbstractRouter.freeze*   s	    r&   requestAbstractMatchInfoc                    K   yw)z#Return MATCH_INFO for given requestNr)   r#   r2   s     r$   resolvezAbstractRouter.resolve.           r   N)__name__
__module____qualname__r%   r   r+   propertyboolr/   r1   r   r   r6   r)   r&   r$   r   r      s]    [ T     2W 21D 2 2r&   r   c                      e Zd ZdZeedeegee	   f   fd              Z
eedeegee	dz     f   fd              Zeededz  fd              Zedeeef   fd       Zeedeedf   fd	              Zed
eddfd       Zedd       Zy)r3   r)   r   c                      y)zExecute matched request handlerNr)   r"   s    r$   handlerzAbstractMatchInfo.handler7   r,   r&   Nc                      y)z*Expect handler for 100-continue processingNr)   r"   s    r$   expect_handlerz AbstractMatchInfo.expect_handler<   r,   r&   c                      y)z<HTTPException instance raised on router's resolving, or NoneNr)   r"   s    r$   http_exceptionz AbstractMatchInfo.http_exceptionC   r,   r&   c                      y)z;Return a dict with additional info useful for introspectionNr)   r"   s    r$   get_infozAbstractMatchInfo.get_infoH   r,   r&   .c                      y)z\Stack of nested applications.

        Top level application is left-most element.

        Nr)   r"   s    r$   appszAbstractMatchInfo.appsL   r,   r&   r'   c                      y)z)Add application to the nested apps stack.Nr)   r*   s     r$   add_appzAbstractMatchInfo.add_appU   r,   r&   c                      y)zFreeze the match info.

        The method is called after route resolution.

        After the call .add_app() is forbidden.

        Nr)   r"   s    r$   r1   zAbstractMatchInfo.freezeY   r,   r&   r9   )r:   r;   r<   	__slots__r=   r   r   r   r   r   rA   rC   r   rE   dictstrr   rG   tupler   rI   rK   r1   r)   r&   r$   r3   r3   3   s'   I.7)Y~-F"FG .  . 9	7)Y~'<==	>9  9
 K 4 K  K J$sCx. J J eK,-    8; 84 8 8  r&   r3   c                   X    e Zd ZdZdeddfdZedefd       Zede	dde
f   fd       Zy)AbstractViewzAbstract class based view.r2   r   Nc                     || _         y r.   _requestr5   s     r$   r%   zAbstractView.__init__g   s	    r&   c                     | j                   S )zRequest instance.rT   r"   s    r$   r2   zAbstractView.requestj   s     }}r&   c                      y)zExecute the view handler.Nr)   r"   s    r$   	__await__zAbstractView.__await__o   r,   r&   )r:   r;   r<   __doc__r   r%   r=   r2   r   r   r   rX   r)   r&   r$   rR   rR   d   sZ    $   D      (9T4%?@ ( (r&   rR   c                   N    e Zd ZU dZeed<   eed<   eed<   eed<   eed<   eed<   y)	ResolveResulta  Resolve result.

    This is the result returned from an AbstractResolver's
    resolve method.

    :param hostname: The hostname that was provided.
    :param host: The IP address that was resolved.
    :param port: The port that was resolved.
    :param family: The address family that was resolved.
    :param proto: The protocol that was resolved.
    :param flags: The flags that were resolved.
    hostnamehostportfamilyprotoflagsN)r:   r;   r<   rY   rO   __annotations__intr)   r&   r$   r[   r[   t   s'     M
I
IKJJr&   r[   c                   x    e Zd ZdZedej                  fdededej                  de
e   fd       Zed
d	       Zy)AbstractResolverzAbstract DNS resolver.r   r]   r^   r_   r   c                    K   yw)z$Return IP address for given hostnameNr)   )r#   r]   r^   r_   s       r$   r6   zAbstractResolver.resolve   r7   r8   Nc                    K   yw)zRelease resolverNr)   r"   s    r$   closezAbstractResolver.close   r7   r8   r9   )r:   r;   r<   rY   r   socketAF_INETrO   rc   AddressFamilylistr[   r6   rh   r)   r&   r$   re   re      s_     %&v~~33"3060D0D3	m	3 3
  r&   re   zMorsel[str]c                      e Zd ZdZdddej
                  dz  ddfdZeede	fd              Z
eede	fd              Zeedeeeef   ef   fd	              Zeedeeeef      fd
              Zeddedz  ddfd       Zededdfd       Ze e       fdededdfd       Zdee   deddfdZededdfd       Zy)AbstractCookieJarzAbstract Cookie Jar.N)loopro   r   c                >    |xs t        j                         | _        y r.   )asyncioget_running_loop_loop)r#   ro   s     r$   r%   zAbstractCookieJar.__init__   s    7W557
r&   c                      y)z5Return True if cookies can be used with IP addresses.Nr)   r"   s    r$   unsafezAbstractCookieJar.unsafe   r,   r&   c                      y)z(Return True if cookies should be quoted.Nr)   r"   s    r$   quote_cookiezAbstractCookieJar.quote_cookie   r,   r&   c                      y)z&Return the cookies stored in this jar.Nr)   r"   s    r$   cookieszAbstractCookieJar.cookies   r,   r&   c                      y)z0Return the host-only cookies stored in this jar.Nr)   r"   s    r$   host_only_cookiesz#AbstractCookieJar.host_only_cookies   r,   r&   	predicatec                      y)z,Clear all cookies if no predicate is passed.Nr)   )r#   r|   s     r$   clearzAbstractCookieJar.clear   r,   r&   domainc                      y)z0Clear all cookies for domain and all subdomains.Nr)   )r#   r   s     r$   clear_domainzAbstractCookieJar.clear_domain   r,   r&   ry   response_urlc                      y)zUpdate cookies.Nr)   )r#   ry   r   s      r$   update_cookiesz AbstractCookieJar.update_cookies   r,   r&   headersc                 J    |r!t        |      x}r| j                  ||       yyy)z+Update cookies from raw Set-Cookie headers.N)r   r   )r#   r   r   cookies_to_updates       r$   update_cookies_from_headersz-AbstractCookieJar.update_cookies_from_headers   s1     -Eg-NN)N 1<@ O7r&   request_urlzBaseCookie[str]c                      y)z6Return the jar's cookies filtered by their attributes.Nr)   )r#   r   s     r$   filter_cookiesz AbstractCookieJar.filter_cookies   r,   r&   r.   )r:   r;   r<   rY   rq   AbstractEventLoopr%   r=   r   r>   ru   rw   r   rP   rO   r   ry   	frozensetr{   ClearCookiePredicater~   r   r   r   r   r	   r   r   r)   r&   r$   rn   rn      s   CG 8 9 9D @ 8D 8 D D  D 7d 7  7 5)%S/<*GH 5  5 ?9U38_#= ?  ? ;3d: ;d ; ; ?3 ?4 ? ? HK l # RV  A}A47A	A E# E2C E Er&   rn   c                       e Zd ZU dZdZeed<   dZeed<   dZedz  ed<   e	de
ez  ez  ddfd	       Ze	dde
ddfd
       Ze	dd       Ze		 ddededz  ddfd       Ze	dd       Ze	deddddfd       ZddZy)AbstractStreamWriterzAbstract stream writer.r   buffer_sizeoutput_sizeNlengthchunkr   c                    K   yw)zWrite chunk into stream.Nr)   r#   r   s     r$   writezAbstractStreamWriter.write   r7   r8   c                    K   yw)zWrite last chunk.Nr)   r   s     r$   	write_eofzAbstractStreamWriter.write_eof   r7   r8   c                    K   yw)zFlush the write buffer.Nr)   r"   s    r$   drainzAbstractStreamWriter.drain   r7   r8   encodingstrategyc                      y)zEnable HTTP body compressionNr)   )r#   r   r   s      r$   enable_compressionz'AbstractStreamWriter.enable_compression   r,   r&   c                      y)zEnable HTTP chunked modeNr)   r"   s    r$   enable_chunkingz$AbstractStreamWriter.enable_chunking   r,   r&   status_liner   zCIMultiDict[str]c                    K   yw)zWrite HTTP headersNr)   )r#   r   r   s      r$   write_headersz"AbstractStreamWriter.write_headers   r7   r8   c                      y)zForce sending buffered headers if not already sent.

        Required only if write_headers() buffers headers instead of sending immediately.
        For backwards compatibility, this method does nothing by default.
        Nr)   r"   s    r$   send_headersz!AbstractStreamWriter.send_headers   r,   r&   )r&   r9   )deflateN)r:   r;   r<   rY   r   rc   rb   r   r   r   bytes	bytearray
memoryviewr   r   r   rO   r   r   r   r   r)   r&   r$   r   r      s    !KKFC$J'!2Z!? 'D ' '  U  T     & & @D++36:+	+ +
 ' ' !!);!	! !
r&   r   c            	       t    e Zd ZdZdZdej                  deddfdZe	de
d	ed
eddfd       Zedefd       Zy)AbstractAccessLoggerzAbstract writer to access log.logger
log_formatr   r   r   Nc                      || _         || _        y r.   r   )r#   r   r   s      r$   r%   zAbstractAccessLogger.__init__  s    $r&   r2   responsetimec                      y)zEmit log to logger.Nr)   )r#   r2   r   r   s       r$   logzAbstractAccessLogger.log  r,   r&   c                      y)zCheck if logger is enabled.Tr)   r"   s    r$   enabledzAbstractAccessLogger.enabled  s     r&   )r:   r;   r<   rY   rM   loggingLoggerrO   r%   r   r   r   floatr   r=   r>   r   r)   r&   r$   r   r      st    ((I%w~~ %3 %4 % "; ". " "RV " "   r&   r   )4rq   r   ri   abcr   r   collections.abcr   r   r   r   r	   r
   http.cookiesr   r   r   typesr   typingr   r   r   	multidictr   yarlr   _cookie_helpersr   typedefsr   web_appr   web_exceptionsr   web_requestr   r   web_responser   r   r3   rR   r[   re   rO   IterableBaser>   r   rn   r   r   r)   r&   r$   <module>r      s       # U U 9 9 " 0 0 !  5 "$-1,;>>K>'>K.M2S 22. .b(3 ( I ,s  F3K(LL   56 /E| /Ed(3 (V3 r&   