o
    +if|                     @   s  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 d dlmZ d dlmZ dd	lmZ dd
lmZ erkd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)eree	e*  Z+neZ+edge,f Z-G dd dee+Z.G dd deZ/G dd deZ0dS )    N)ABCabstractmethod)Sized)
BaseCookieMorsel)
TYPE_CHECKINGAny	AwaitableCallableDict	GeneratorIterableListOptionalTuple)CIMultiDict)URL   )get_running_loop)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!   D/var/www/html/corbot_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"   frozen/   s   zAbstractRouter.frozenc                 C   s
   d| _ dS )zFreeze router.TNr   r   r!   r!   r"   freeze3   s   
zAbstractRouter.freezerequestAbstractMatchInfoc                       dS )z#Return MATCH_INFO for given requestNr!   r    r.   r!   r!   r"   resolve7       zAbstractRouter.resolver   N)__name__
__module____qualname__r#   r   r(   propertyboolr,   r-   r   r   r2   r!   r!   r!   r"   r   #   s    

r   c                   @   s   e 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 )r/   r   c                 C   r&   )zExecute matched request handlerNr!   r   r!   r!   r"   handler=   r)   zAbstractMatchInfo.handlerc                 C   r&   )z*Expect handler for 100-continue processingNr!   r   r!   r!   r"   expect_handlerB   r)   z AbstractMatchInfo.expect_handlerc                 C   r&   )z<HTTPException instance raised on router's resolving, or NoneNr!   r   r!   r!   r"   http_exceptionI   r)   z AbstractMatchInfo.http_exceptionc                 C   r&   )z;Return a dict with additional info useful for introspectionNr!   r   r!   r!   r"   get_infoN   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"   appsR   r)   zAbstractMatchInfo.appsr%   Nc                 C   r&   )z)Add application to the nested apps stack.Nr!   r'   r!   r!   r"   add_app[   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-   _   r)   zAbstractMatchInfo.freezer4   )r5   r6   r7   r8   r   r
   r   r	   r   r:   r   r;   r   r<   r   strr   r=   r   r   r>   r?   r-   r!   r!   r!   r"   r/   <   s*     r/   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+   _requestr1   r!   r!   r"   r#   m   r$   zAbstractView.__init__c                 C   r*   )zRequest instance.rB   r   r!   r!   r"   r.   p   s   zAbstractView.requestc                 C   r&   )zExecute the view handler.Nr!   r   r!   r!   r"   	__await__u   r)   zAbstractView.__await__)r5   r6   r7   __doc__r   r#   r8   r.   r   r   r   r   rD   r!   r!   r!   r"   rA   j   s    rA   c                   @   sH   e Zd ZdZededededeeee	f  fddZ
edd	d
ZdS )AbstractResolverzAbstract DNS resolver.hostportfamilyr   c                    r0   )z$Return IP address for given hostnameNr!   )r    rG   rH   rI   r!   r!   r"   r2   }   r3   zAbstractResolver.resolveNc                    r0   )zRelease resolverNr!   r   r!   r!   r"   close   r3   zAbstractResolver.closer4   )r5   r6   r7   rE   r   r@   intr   r   r   r2   rJ   r!   r!   r!   r"   rF   z   s    (rF   zMorsel[str]c                   @   s   e Zd ZdZdddeej dd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)looprM   r   c                C   s   t || _d S r+   )r   _loop)r    rM   r!   r!   r"   r#      s   zAbstractCookieJar.__init__	predicatec                 C   r&   )z,Clear all cookies if no predicate is passed.Nr!   )r    rO   r!   r!   r"   clear   r)   zAbstractCookieJar.cleardomainc                 C   r&   )z0Clear all cookies for domain and all subdomains.Nr!   )r    rQ   r!   r!   r"   clear_domain   r)   zAbstractCookieJar.clear_domaincookiesresponse_urlc                 C   r&   )zUpdate cookies.Nr!   )r    rS   rT   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    rV   r!   r!   r"   filter_cookies   r)   z AbstractCookieJar.filter_cookiesr+   )r5   r6   r7   rE   r   asyncioAbstractEventLoopr#   r   ClearCookiePredicaterP   r@   rR   r   r   rU   rW   r!   r!   r!   r"   rL      s    rL   c                   @   s   e Zd ZU dZdZdZdZee e	d< e
deddfddZe
ddeddfd
dZe
dddZe
d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   lengthchunkr   Nc                    r0   )zWrite chunk into stream.Nr!   r    r]   r!   r!   r"   write   r3   zAbstractStreamWriter.write    c                    r0   )zWrite last chunk.Nr!   r^   r!   r!   r"   	write_eof   r3   zAbstractStreamWriter.write_eofc                    r0   )zFlush the write buffer.Nr!   r   r!   r!   r"   drain   r3   zAbstractStreamWriter.draindeflateencodingc                 C   r&   )zEnable HTTP body compressionNr!   )r    rd   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                    r0   )zWrite HTTP headersNr!   )r    rg   rh   r!   r!   r"   write_headers   r3   z"AbstractStreamWriter.write_headers)r`   r4   )rc   )r5   r6   r7   rE   buffer_sizeoutput_sizer\   r   rK   __annotations__r   bytesr_   ra   rb   r@   re   rf   ri   r!   r!   r!   r"   r[      s.   
 r[   c                	   @   sF   e 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dS )AbstractAccessLoggerzAbstract writer to access log.logger
log_formatr   Nc                 C   s   || _ || _d S r+   )ro   rp   )r    ro   rp   r!   r!   r"   r#      s   
zAbstractAccessLogger.__init__r.   responsetimec                 C   r&   )zEmit log to logger.Nr!   )r    r.   rq   rr   r!   r!   r"   log   r)   zAbstractAccessLogger.log)r5   r6   r7   rE   loggingLoggerr@   r#   r   r   r   floatrs   r!   r!   r!   r"   rn      s
     rn   )1rX   rt   abcr   r   collections.abcr   http.cookiesr   r   typingr   r   r	   r
   r   r   r   r   r   r   	multidictr   yarlr   helpersr   typedefsr   web_appr   web_exceptionsr   web_requestr   r   web_responser   r   r/   rA   rF   r@   IterableBaser9   rZ   rL   r[   rn   r!   r!   r!   r"   <module>   s8    0."