a
    8öjí  ã                   @   sª  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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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�rbee
e/  Z0neZ0edge1f Z2G dd„ dee0ƒZ3G dd„ deƒZ4G dd„ deƒZ5dS ) é    N)ÚABCÚabstractmethod)ÚSized)Ú
BaseCookieÚMorsel)ÚTYPE_CHECKINGÚAnyÚ	AwaitableÚCallableÚDictÚ	GeneratorÚIterableÚListÚOptionalÚSequenceÚTupleÚ	TypedDictÚUnion)ÚCIMultiDict)ÚURLé   )Úparse_set_cookie_headers)Ú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©Z_frozen©Úself© r$   úJ/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/aiohttp/abc.pyÚ__init__(   s    zAbstractRouter.__init__©Úappr    c                 C   s   dS )zºPost 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%   Úfrozen3   s    zAbstractRouter.frozenc                 C   s
   d| _ dS )zFreeze router.TNr!   r"   r$   r$   r%   Úfreeze7   s    zAbstractRouter.freezeÚAbstractMatchInfo©Úrequestr    c                 Ã   s   dS )z#Return MATCH_INFO for given requestNr$   ©r#   r0   r$   r$   r%   Úresolve;   s    zAbstractRouter.resolve)Ú__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dZeeeegee	 f dœdd„ƒƒZ
eeeegeee	  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$   r   c                 C   s   dS )zExecute matched request handlerNr$   r"   r$   r$   r%   ÚhandlerD   s    zAbstractMatchInfo.handlerc                 C   s   dS )z*Expect handler for 100-continue processingNr$   r"   r$   r$   r%   Úexpect_handlerI   s    z AbstractMatchInfo.expect_handlerc                 C   s   dS )z<HTTPException instance raised on router's resolving, or NoneNr$   r"   r$   r$   r%   Úhttp_exceptionP   s    z AbstractMatchInfo.http_exceptionc                 C   s   dS )z;Return a dict with additional info useful for introspectionNr$   r"   r$   r$   r%   Úget_infoU   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%   ÚappsY   s    zAbstractMatchInfo.appsNr'   c                 C   s   dS )z)Add application to the nested apps stack.Nr$   r)   r$   r$   r%   Úadd_appb   s    zAbstractMatchInfo.add_appc                 C   s   dS )z‡Freeze the match info.

        The method is called after route resolution.

        After the call .add_app() is forbidden.

        Nr$   r"   r$   r$   r%   r-   f   s    zAbstractMatchInfo.freeze)r3   r4   r5   Ú	__slots__r6   r   r
   r   r	   r   r8   r   r9   r   r:   r   Ústrr   r;   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	dde
f dœd	d
„ƒZdS )ÚAbstractViewzAbstract class based view.Nr/   c                 C   s
   || _ d S r+   ©Ú_requestr1   r$   r$   r%   r&   t   s    zAbstractView.__init__r   c                 C   s   | j S )zRequest instance.rA   r"   r$   r$   r%   r0   w   s    zAbstractView.requestc                 C   s   dS )zExecute the view handler.Nr$   r"   r$   r$   r%   Ú	__await__|   s    zAbstractView.__await__)r3   r4   r5   Ú__doc__r   r&   r6   r0   r   r   r   rC   r$   r$   r$   r%   r@   q   s   r@   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)r3   r4   r5   rD   r?   Ú__annotations__Úintr$   r$   r$   r%   rE   �   s   
rE   c                   @   sH   e Zd ZdZedejfeeej	e
e dœdd„ƒZeddœdd	„ƒZdS )
ÚAbstractResolverzAbstract DNS resolver.r   )rG   rH   rI   r    c                 Ã   s   dS )z$Return IP address for given hostnameNr$   )r#   rG   rH   rI   r$   r$   r%   r2   š   s    zAbstractResolver.resolveNr   c                 Ã   s   dS )zRelease resolverNr$   r"   r$   r$   r%   Úclose    s    zAbstractResolver.close)r3   r4   r5   rD   r   ÚsocketÚAF_INETr?   rM   ÚAddressFamilyr   rE   r2   rO   r$   r$   r$   r%   rN   —   s   ÿþrN   zMorsel[str]c                   @   s¶   e Zd ZdZddœeej ddœdd„Zee	e
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 eddœdd„Ze	eddœdd„ƒZdS )ÚAbstractCookieJarzAbstract Cookie Jar.N)Úloop)rT   r    c                C   s   |p
t  ¡ | _d S r+   )ÚasyncioZget_running_loopÚ_loop)r#   rT   r$   r$   r%   r&   ±   s    zAbstractCookieJar.__init__r   c                 C   s   dS )z(Return True if cookies should be quoted.Nr$   r"   r$   r$   r%   Úquote_cookie´   s    zAbstractCookieJar.quote_cookie)Ú	predicater    c                 C   s   dS )z,Clear all cookies if no predicate is passed.Nr$   )r#   rX   r$   r$   r%   Úclear¹   s    zAbstractCookieJar.clear)Údomainr    c                 C   s   dS )z0Clear all cookies for domain and all subdomains.Nr$   )r#   rZ   r$   r$   r%   Úclear_domain½   s    zAbstractCookieJar.clear_domain)ÚcookiesÚresponse_urlr    c                 C   s   dS )zUpdate cookies.Nr$   )r#   r\   r]   r$   r$   r%   Úupdate_cookiesÁ   s    z AbstractCookieJar.update_cookies)Úheadersr]   r    c                 C   s    |rt |ƒ }r|  ||¡ dS )z+Update cookies from raw Set-Cookie headers.N)r   r^   )r#   r_   r]   Zcookies_to_updater$   r$   r%   Úupdate_cookies_from_headersÅ   s    z-AbstractCookieJar.update_cookies_from_headerszBaseCookie[str])Úrequest_urlr    c                 C   s   dS )z6Return the jar's cookies filtered by their attributes.Nr$   )r#   ra   r$   r$   r%   Úfilter_cookiesÌ   s    z AbstractCookieJar.filter_cookies)N)r3   r4   r5   rD   r   rU   ZAbstractEventLoopr&   r6   r   r7   rW   ÚClearCookiePredicaterY   r?   r[   r   r   r^   r   r`   rb   r$   r$   r$   r%   rS   ®   s    þrS   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
eeeef ddœdd	„ƒZe
deddœdd„ƒZe
ddœdd„ƒZe
dee	e ddœdd„ƒZe
ddœdd„ƒZe
edddœdd„ƒZddœdd„ZdS )ÚAbstractStreamWriterzAbstract stream writer.r   Úbuffer_sizeÚoutput_sizeÚlengthN)Úchunkr    c                 Ã   s   dS )zWrite chunk into stream.Nr$   ©r#   rh   r$   r$   r%   ÚwriteØ   s    zAbstractStreamWriter.writeó    c                 Ã   s   dS )zWrite last chunk.Nr$   ri   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)ÚencodingÚstrategyr    c                 C   s   dS )zEnable HTTP body compressionNr$   )r#   ro   rp   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_liner_   r    c                 Ã   s   dS )zWrite HTTP headersNr$   )r#   rs   r_   r$   r$   r%   Úwrite_headersî   s    z"AbstractStreamWriter.write_headersc                 C   s   dS )zàForce 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"   r$   r$   r%   Úsend_headersô   s    z!AbstractStreamWriter.send_headers)rk   )rn   N)r3   r4   r5   rD   re   rM   rL   rf   rg   r   r   r   ÚbytesÚ	bytearrayÚ
memoryviewrj   rl   rm   r?   rq   rr   rt   ru   r$   r$   r$   r%   rd   Ñ   s.   
 ÿþþrd   c                   @   sR   e Zd ZdZdZejeddœdd„Ze	e
eeddœdd	„ƒZeed
œdd„ƒZdS )ÚAbstractAccessLoggerzAbstract writer to access log.©ÚloggerÚ
log_formatN)r{   r|   r    c                 C   s   || _ || _d S r+   rz   )r#   r{   r|   r$   r$   r%   r&     s    zAbstractAccessLogger.__init__)r0   ÚresponseÚtimer    c                 C   s   dS )zEmit log to logger.Nr$   )r#   r0   r}   r~   r$   r$   r%   Úlog  s    zAbstractAccessLogger.logr   c                 C   s   dS )zCheck if logger is enabled.Tr$   r"   r$   r$   r%   Úenabled	  s    zAbstractAccessLogger.enabled)r3   r4   r5   rD   r>   ÚloggingÚLoggerr?   r&   r   r   r   Úfloatr   r6   r7   r€   r$   r$   r$   r%   ry   ü   s   ry   )6rU   r�   rP   Úabcr   r   Úcollections.abcr   Úhttp.cookiesr   r   Útypingr   r   r	   r
   r   r   r   r   r   r   r   r   r   Z	multidictr   Zyarlr   Z_cookie_helpersr   Ztypedefsr   Zweb_appr   Zweb_exceptionsr   Zweb_requestr   r   Zweb_responser   r   r.   r@   rE   rN   r?   ZIterableBaser7   rc   rS   rd   ry   r$   r$   r$   r%   Ú<module>   s:   <1#+