o
    RÊÆh¤  ã                   @   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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                   @   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!   úX/var/www/html/HyperOracle/crypto_trader/venv/lib/python3.10/site-packages/aiohttp/abc.pyÚ__init__$   ó   
zAbstractRouter.__init__Úappc                 C   ó   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'   ó    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&   )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-   _   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."