HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-37.pyc
B

L��g��@s�ddlmZddlZddlZddlZddlmZmZmZm	Z	ddl
mZddlm
Z
ddlmZmZddlmZer�ddlmZmZdd	lmZdd
lmZddlmZddlmZGd
d�de�ZdS)�)�annotationsN)�
TYPE_CHECKING�Any�
Collection�Mapping)�HTTPAdapter)�	DictCache)�PERMANENT_REDIRECT_STATUSES�CacheController)�CallbackFileWrapper)�PreparedRequest�Response)�HTTPResponse)�	BaseCache)�
BaseHeuristic)�
Serializercs�eZdZdddhZd"dddd	d
dddd
d�	�fdd�
Zd#ddddddddd��fdd�
Zd$dddddd��fdd�
Zd
d��fd d!�Z�ZS)%�CacheControlAdapter�PUT�PATCH�DELETENTzBaseCache | None�boolztype[CacheController] | NonezSerializer | NonezBaseHeuristic | NonezCollection[str] | Noner�None)	�cache�cache_etags�controller_class�
serializer�	heuristic�cacheable_methods�args�kw�returnc
sPt�j||�|dkrt�n||_||_|p.d|_|p8t}	|	|j||d�|_dS)N)�GET)rr)�super�__init__rrrrr
�
controller)
�selfrrrrrrrr�controller_factory)�	__class__��D/tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/cachecontrol/adapter.pyr#s
zCacheControlAdapter.__init__Frz7None | float | tuple[float, float] | tuple[float, None]z
bool | strz4None | bytes | str | tuple[bytes | str, bytes | str]zMapping[str, str] | Noner
)�request�stream�timeout�verify�cert�proxiesrr cs�|p|j}|j|krhy|j�|�}	Wntjk
r>d}	YnX|	rT|j||	dd�S|j�|j�	|��t
��||||||�}
|
S)z�
        Send a request. Use the request information to see if it
        exists in the cache and cache the response if we need to and can.
        NT)�
from_cache)r�methodr$�cached_request�zlib�error�build_response�headers�update�conditional_headersr"�send)r%r*r+r,r-r.r/r�	cacheable�cached_response�resp)r'r(r)r92s


zCacheControlAdapter.sendr)r*�responser0rr c
s(|p|j}|s�|j|kr�|jr*|j�|�}|jdkrh|j�||�}||k	rNd}|jdd�|��|}nht	|j�t
kr�|j�||�nJt|j
t�|jj||��|_
|jr�|j�ddd��fdd	�}t�||�|_t��||�}|j|jk�r|j�r|jd
k	�st�|j�|j�}	|j�|	�||_|S)z�
        Build a response by making a request or using the cache.

        This will end up calling send and returning a potentially
        cached response
        i0TF)�decode_contentrr)r%r cs��|jdkr|j��dS)Nr)�
chunk_left�_fp�_close)r%)�super_update_chunk_lengthr(r)�_update_chunk_length�s
z@CacheControlAdapter.build_response.<locals>._update_chunk_lengthN)rr1r�apply�statusr$�update_cached_response�read�release_conn�intr	�cache_responserr@�	functools�partial�chunkedrC�types�
MethodTyper"r5�invalidating_methods�ok�url�AssertionError�	cache_urlr�deleter0)
r%r*r=r0rr:r;rCr<rT)r')rBr)r5Ps<


z"CacheControlAdapter.build_response)r cs|j��t���dS)N)r�closer")r%)r'r(r)rV�s
zCacheControlAdapter.close)NTNNNN)FNTNNN)FN)	�__name__�
__module__�__qualname__rPr#r9r5rV�
__classcell__r(r()r'r)rs 
$"Jr)�
__future__rrKrNr3�typingrrrrZpip._vendor.requests.adaptersrZpip._vendor.cachecontrol.cacherZ#pip._vendor.cachecontrol.controllerr	r
Z$pip._vendor.cachecontrol.filewrapperrZpip._vendor.requestsrr
Zpip._vendor.urllib3rrZ#pip._vendor.cachecontrol.heuristicsrZ"pip._vendor.cachecontrol.serializerrr(r(r(r)�<module>s