o
    zsgp                     @   s  d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ d dl	m
Z
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 d dlmZ d dlmZ dd	lmZ erqdd
lm Z  ddl!m"Z" ddl#m$Z$m%Z% ddl&m'Z' n
d Z$ Z% Z Z'dZ"G dd deZ(G dd deZ)G dd deZ*G dd deZ+G dd deZ,ereee-  Z.neZ.edge/f Z0G dd dee.Z1G dd deZ2G dd deZ3dS )    N)ABCabstractmethod)Sized)
BaseCookieMorsel)TYPE_CHECKINGAny	AwaitableCallableDict	GeneratorIterableListOptionalTuple	TypedDictUnion)CIMultiDict)URL   )LooseCookies)Application)HTTPException)BaseRequestRequest)StreamResponsec                   @   sZ   e Zd ZdddZdeddfddZedefdd	Zdd
dZ	e
deddfddZdS )AbstractRouterreturnNc                 C   s
   d| _ d S )NF_frozenself r"   G/var/www/html/minecraft/env/lib/python3.10/site-packages/aiohttp/abc.py__init__'      
zAbstractRouter.__init__appc                 C      dS )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.
        Nr"   r!   r&   r"   r"   r#   	post_init*       zAbstractRouter.post_initc                 C      | j S Nr   r    r"   r"   r#   frozen2   s   zAbstractRouter.frozenc                 C   s
   d| _ dS )zFreeze router.TNr   r    r"   r"   r#   freeze6   s   
zAbstractRouter.freezerequestAbstractMatchInfoc                       dS )z#Return MATCH_INFO for given requestNr"   r!   r/   r"   r"   r#   resolve:       zAbstractRouter.resolver   N)__name__
__module____qualname__r$   r   r)   propertyboolr-   r.   r   r   r3   r"   r"   r"   r#   r   &   s    

r   c                   @   s   e Zd ZdZeedeegee	 f fddZ
eedeegeee	  f fddZeedee fddZedeeef fd	d
Zeedeedf fddZededdfddZedddZdS )r0   r"   r   c                 C   r'   )zExecute matched request handlerNr"   r    r"   r"   r#   handlerC   r*   zAbstractMatchInfo.handlerc                 C   r'   )z*Expect handler for 100-continue processingNr"   r    r"   r"   r#   expect_handlerH   r*   z AbstractMatchInfo.expect_handlerc                 C   r'   )z<HTTPException instance raised on router's resolving, or NoneNr"   r    r"   r"   r#   http_exceptionO   r*   z AbstractMatchInfo.http_exceptionc                 C   r'   )z;Return a dict with additional info useful for introspectionNr"   r    r"   r"   r#   get_infoT   r*   zAbstractMatchInfo.get_info.c                 C   r'   )z\Stack of nested applications.

        Top level application is left-most element.

        Nr"   r    r"   r"   r#   appsX   r*   zAbstractMatchInfo.appsr&   Nc                 C   r'   )z)Add application to the nested apps stack.Nr"   r(   r"   r"   r#   add_appa   r*   zAbstractMatchInfo.add_appc                 C   r'   )zFreeze the match info.

        The method is called after route resolution.

        After the call .add_app() is forbidden.

        Nr"   r    r"   r"   r#   r.   e   r*   zAbstractMatchInfo.freezer5   )r6   r7   r8   	__slots__r9   r   r
   r   r	   r   r;   r   r<   r   r=   r   strr   r>   r   r   r?   r@   r.   r"   r"   r"   r#   r0   ?   s,     r0   c                   @   sP   e Zd ZdZdeddfddZedefddZede	e
def fd	d
ZdS )AbstractViewzAbstract class based view.r/   r   Nc                 C   s
   || _ d S r,   _requestr2   r"   r"   r#   r$   s   r%   zAbstractView.__init__c                 C   r+   )zRequest instance.rD   r    r"   r"   r#   r/   v   s   zAbstractView.requestc                 C   r'   )zExecute the view handler.Nr"   r    r"   r"   r#   	__await__{   r*   zAbstractView.__await__)r6   r7   r8   __doc__r   r$   r9   r/   r   r   r   r   rF   r"   r"   r"   r#   rC   p   s    rC   c                   @   sB   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< dS )	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)r6   r7   r8   rG   rB   __annotations__intr"   r"   r"   r#   rH      s   
 rH   c                   @   sJ   e Zd ZdZedejfdededej	de
e fddZedd
dZd	S )AbstractResolverzAbstract DNS resolver.r   rJ   rK   rL   r   c                    r1   )z$Return IP address for given hostnameNr"   )r!   rJ   rK   rL   r"   r"   r#   r3      r4   zAbstractResolver.resolveNc                    r1   )zRelease resolverNr"   r    r"   r"   r#   close   r4   zAbstractResolver.closer5   )r6   r7   r8   rG   r   socketAF_INETrB   rP   AddressFamilyr   rH   r3   rR   r"   r"   r"   r#   rQ      s    rQ   zMorsel[str]c                   @   s   e Zd ZdZdddeej ddfddZee	de
fdd	Ze	dd
ee ddfddZe	deddfddZe	e fdededdfddZe	deddfddZdS )AbstractCookieJarzAbstract Cookie Jar.N)looprW   r   c                C   s   |pt  | _d S r,   )asyncioget_running_loop_loop)r!   rW   r"   r"   r#   r$      s   zAbstractCookieJar.__init__c                 C   r'   )z(Return True if cookies should be quoted.Nr"   r    r"   r"   r#   quote_cookie   r*   zAbstractCookieJar.quote_cookie	predicatec                 C   r'   )z,Clear all cookies if no predicate is passed.Nr"   )r!   r\   r"   r"   r#   clear   r*   zAbstractCookieJar.cleardomainc                 C   r'   )z0Clear all cookies for domain and all subdomains.Nr"   )r!   r^   r"   r"   r#   clear_domain   r*   zAbstractCookieJar.clear_domaincookiesresponse_urlc                 C   r'   )zUpdate cookies.Nr"   )r!   r`   ra   r"   r"   r#   update_cookies   r*   z AbstractCookieJar.update_cookiesrequest_urlzBaseCookie[str]c                 C   r'   )z6Return the jar's cookies filtered by their attributes.Nr"   )r!   rc   r"   r"   r#   filter_cookies   r*   z AbstractCookieJar.filter_cookiesr,   )r6   r7   r8   rG   r   rX   AbstractEventLoopr$   r9   r   r:   r[   ClearCookiePredicater]   rB   r_   r   r   rb   rd   r"   r"   r"   r#   rV      s    rV   c                   @   s   e Zd ZU dZdZeed< dZeed< dZe	e ed< e
deeeef ddfd	d
Ze
ddeddfddZe
dddZe
dejfdededdfddZe
dddZe
deddddfddZdS )AbstractStreamWriterzAbstract stream writer.r   buffer_sizeoutput_sizelengthchunkr   Nc                    r1   )zWrite chunk into stream.Nr"   r!   rk   r"   r"   r#   write   r4   zAbstractStreamWriter.write    c                    r1   )zWrite last chunk.Nr"   rl   r"   r"   r#   	write_eof   r4   zAbstractStreamWriter.write_eofc                    r1   )zFlush the write buffer.Nr"   r    r"   r"   r#   drain   r4   zAbstractStreamWriter.draindeflateencodingstrategyc                 C   r'   )zEnable HTTP body compressionNr"   )r!   rr   rs   r"   r"   r#   enable_compression   r*   z'AbstractStreamWriter.enable_compressionc                 C   r'   )zEnable HTTP chunked modeNr"   r    r"   r"   r#   enable_chunking   r*   z$AbstractStreamWriter.enable_chunkingstatus_lineheaderszCIMultiDict[str]c                    r1   )zWrite HTTP headersNr"   )r!   rv   rw   r"   r"   r#   write_headers   r4   z"AbstractStreamWriter.write_headers)rn   r5   )r6   r7   r8   rG   rh   rP   rO   ri   rj   r   r   r   bytes	bytearray
memoryviewrm   ro   rp   zlibZ_DEFAULT_STRATEGYrB   rt   ru   rx   r"   r"   r"   r#   rg      s<   
 rg   c                	   @   s\   e Zd ZdZdZdejdeddfddZe	d	e
d
ededdfddZedefddZdS )AbstractAccessLoggerzAbstract writer to access log.logger
log_formatr   r   r   Nc                 C   s   || _ || _d S r,   r   )r!   r   r   r"   r"   r#   r$      s   
zAbstractAccessLogger.__init__r/   responsetimec                 C   r'   )zEmit log to logger.Nr"   )r!   r/   r   r   r"   r"   r#   log   r*   zAbstractAccessLogger.logc                 C   r'   )zCheck if logger is enabled.Tr"   r    r"   r"   r#   enabled   s   zAbstractAccessLogger.enabled)r6   r7   r8   rG   rA   loggingLoggerrB   r$   r   r   r   floatr   r9   r:   r   r"   r"   r"   r#   r~      s    r~   )4rX   r   rS   r|   abcr   r   collections.abcr   http.cookiesr   r   typingr   r   r	   r
   r   r   r   r   r   r   r   r   	multidictr   yarlr   typedefsr   web_appr   web_exceptionsr   web_requestr   r   web_responser   r   r0   rC   rH   rQ   rB   IterableBaser:   rf   rV   rg   r~   r"   r"   r"   r#   <module>   s<    81$