a
    |fP                     @   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rd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r>e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                   @   s^   e Zd ZddddZeddddZeeddd	Zddd
dZ	e
eddddZdS )AbstractRouterNreturnc                 C   s
   d| _ d S )NF_frozenself r"   ED:\Projects\storyit_web\backend\venv\Lib\site-packages\aiohttp/abc.py__init__$   s    zAbstractRouter.__init__appr   c                 C   s   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'   s    zAbstractRouter.post_initc                 C   s   | 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AbstractMatchInforequestr   c                    s   dS )z#Return MATCH_INFO for given requestNr"   r!   r.   r"   r"   r#   resolve7   s    zAbstractRouter.resolve)__name__
__module____qualname__r$   r   r(   propertyboolr*   r+   r   r   r0   r"   r"   r"   r#   r   #   s   r   c                   @   s   e Zd Zeeeegee f dddZ	eeeeged f dddZ
eeee dddZeeeef dd	d
Zeeeedf dddZeeddddZeddddZdS )r,   r   c                 C   s   dS )zExecute matched request handlerNr"   r    r"   r"   r#   handler=   s    zAbstractMatchInfo.handlerNc                 C   s   dS )z*Expect handler for 100-continue processingNr"   r    r"   r"   r#   expect_handlerB   s    z AbstractMatchInfo.expect_handlerc                 C   s   dS )z<HTTPException instance raised on router's resolving, or NoneNr"   r    r"   r"   r#   http_exceptionG   s    z AbstractMatchInfo.http_exceptionc                 C   s   dS )z;Return a dict with additional info useful for introspectionNr"   r    r"   r"   r#   get_infoL   s    zAbstractMatchInfo.get_info.c                 C   s   dS )z\Stack of nested applications.

        Top level application is left-most element.

        Nr"   r    r"   r"   r#   appsP   s    zAbstractMatchInfo.appsr%   c                 C   s   dS )z)Add application to the nested apps stack.Nr"   r'   r"   r"   r#   add_appY   s    zAbstractMatchInfo.add_appc                 C   s   dS )zFreeze the match info.

        The method is called after route resolution.

        After the call .add_app() is forbidden.

        Nr"   r    r"   r"   r#   r+   ]   s    zAbstractMatchInfo.freeze)r1   r2   r3   r4   r   r
   r   r	   r   r6   r7   r   r   r8   r   strr   r9   r   r   r:   r;   r+   r"   r"   r"   r#   r,   <   s$     r,   c                   @   sN   e Zd ZdZeddddZeedddZee	e
def dd	d
ZdS )AbstractViewzAbstract class based view.Nr-   c                 C   s
   || _ d S r)   _requestr/   r"   r"   r#   r$   k   s    zAbstractView.__init__r   c                 C   s   | j S )zRequest instance.r>   r    r"   r"   r#   r.   n   s    zAbstractView.requestc                 C   s   dS )zExecute the view handler.Nr"   r    r"   r"   r#   	__await__s   s    zAbstractView.__await__)r1   r2   r3   __doc__r   r$   r4   r.   r   r   r   r   r@   r"   r"   r"   r#   r=   h   s   r=   c                   @   sF   e Zd ZdZeeeeeeee	f  dddZ
eddddZdS )	AbstractResolverzAbstract DNS resolver.)hostportfamilyr   c                    s   dS )z$Return IP address for given hostnameNr"   )r!   rC   rD   rE   r"   r"   r#   r0   {   s    zAbstractResolver.resolveNr   c                    s   dS )zRelease resolverNr"   r    r"   r"   r#   close   s    zAbstractResolver.close)r1   r2   r3   rA   r   r<   intr   r   r   r0   rF   r"   r"   r"   r#   rB   x   s
   "rB   zMorsel[str]c                   @   s   e Zd ZdZddeej ddddZedee	 dddd	Z
eedd
ddZee feeddddZeeddddZdS )AbstractCookieJarzAbstract Cookie Jar.N)loop)rI   r   c                C   s   t || _d S r)   )r   _loop)r!   rI   r"   r"   r#   r$      s    zAbstractCookieJar.__init__)	predicater   c                 C   s   dS )z,Clear all cookies if no predicate is passed.Nr"   )r!   rK   r"   r"   r#   clear   s    zAbstractCookieJar.clear)domainr   c                 C   s   dS )z0Clear all cookies for domain and all subdomains.Nr"   )r!   rM   r"   r"   r#   clear_domain   s    zAbstractCookieJar.clear_domain)cookiesresponse_urlr   c                 C   s   dS )zUpdate cookies.Nr"   )r!   rO   rP   r"   r"   r#   update_cookies   s    z AbstractCookieJar.update_cookieszBaseCookie[str])request_urlr   c                 C   s   dS )z6Return the jar's cookies filtered by their attributes.Nr"   )r!   rR   r"   r"   r#   filter_cookies   s    z AbstractCookieJar.filter_cookies)N)r1   r2   r3   rA   r   asyncioZAbstractEventLoopr$   r   ClearCookiePredicaterL   r<   rN   r   r   rQ   rS   r"   r"   r"   r#   rH      s   rH   c                   @   s   e Zd ZU dZdZdZdZee e	d< e
eddddZe
deddd	d
Ze
ddddZe
deddddZe
ddddZe
edddddZdS )AbstractStreamWriterzAbstract stream writer.r   lengthN)chunkr   c                    s   dS )zWrite chunk into stream.Nr"   r!   rX   r"   r"   r#   write   s    zAbstractStreamWriter.write    c                    s   dS )zWrite last chunk.Nr"   rY   r"   r"   r#   	write_eof   s    zAbstractStreamWriter.write_eofr   c                    s   dS )zFlush the write buffer.Nr"   r    r"   r"   r#   drain   s    zAbstractStreamWriter.draindeflate)encodingr   c                 C   s   dS )zEnable HTTP body compressionNr"   )r!   r_   r"   r"   r#   enable_compression   s    z'AbstractStreamWriter.enable_compressionc                 C   s   dS )zEnable HTTP chunked modeNr"   r    r"   r"   r#   enable_chunking   s    z$AbstractStreamWriter.enable_chunkingzCIMultiDict[str])status_lineheadersr   c                    s   dS )zWrite HTTP headersNr"   )r!   rb   rc   r"   r"   r#   write_headers   s    z"AbstractStreamWriter.write_headers)r[   )r^   )r1   r2   r3   rA   buffer_sizeZoutput_sizerW   r   rG   __annotations__r   bytesrZ   r\   r]   r<   r`   ra   rd   r"   r"   r"   r#   rV      s$   
rV   c                   @   s<   e Zd ZdZejeddddZee	e
eddddZdS )	AbstractAccessLoggerzAbstract writer to access log.N)logger
log_formatr   c                 C   s   || _ || _d S r)   )ri   rj   )r!   ri   rj   r"   r"   r#   r$      s    zAbstractAccessLogger.__init__)r.   responsetimer   c                 C   s   dS )zEmit log to logger.Nr"   )r!   r.   rk   rl   r"   r"   r#   log   s    zAbstractAccessLogger.log)r1   r2   r3   rA   loggingLoggerr<   r$   r   r   r   floatrm   r"   r"   r"   r#   rh      s   rh   )1rT   rn   abcr   r   collections.abcr   http.cookiesr   r   typingr   r   r	   r
   r   r   r   r   r   r   Z	multidictr   Zyarlr   Zhelpersr   Ztypedefsr   Zweb_appr   Zweb_exceptionsr   Zweb_requestr   r   Zweb_responser   r   r,   r=   rB   r<   ZIterableBaser5   rU   rH   rV   rh   r"   r"   r"   r#   <module>   s6   0,"