7B1u d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm Z m Z d dlmZ d dl mZ d dlmZmZ d dlmZ er d dlmZmZ d d lmZ d d l mZ d dlmZ d dlmZ G d de ZdS ) )annotationsN) TYPE_CHECKINGAny CollectionMapping)HTTPAdapter) DictCache)PERMANENT_REDIRECT_STATUSESCacheController)CallbackFileWrapper)PreparedRequestResponse)HTTPResponse) BaseCache) BaseHeuristic) Serializerc n e Zd Zh dZ d)d* fd Z d+d, fd# Z d-d. fd' Zd/ fd(Z xZS )0CacheControlAdapter> PUTPATCHDELETENTcacheBaseCache | Nonecache_etagsboolcontroller_classtype[CacheController] | None serializerSerializer | None heuristicBaseHeuristic | Nonecacheable_methodsCollection[str] | Noneargsr kwreturnNonec t j |i | |t n|| _ || _ |pd| _ |pt } | | j || | _ d S )N)GET)r r )super__init__r r r r" r controller)selfr r r r r r" r$ r% controller_factory __class__s r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_vendor/cachecontrol/adapter.pyr+ zCacheControlAdapter.__init__ sy $%"%%%$)MY[[[u "!2!>h-@,,JKJ Frequestr streamtimeout7None | float | tuple[float, float] | tuple[float, None]verify bool | strcert4None | bytes | str | tuple[bytes | str, bytes | str]proxiesMapping[str, str] | Noner c v |p| j }|j |v r | j | } n# t j $ r d} Y nw xY w| r| || d 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_requestzliberrorbuild_responseheadersupdateconditional_headersr* send)r- r2 r3 r4 r6 r8 r: r" cacheablecached_responserespr/ s r0 rF zCacheControlAdapter.send3 s &?)? >Y&& '"&/"@"@"I"I: ' ' '"& ' V**7OPT*UUU O""4?#F#Fw#O#OPPPww||GVWfdGLLs 0 AAresponser r= c |p| j }|sJ|j |v r@| j r| j | }|j dk rN| j || }||urd}| d | |}nt |j t v r| j || nt |j t j | j j |t! j | |_ |j r>|j j d fd }t j |t! j | |_ t+ || }|j | j v rI|j rB|j J | 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 i0 TF)decode_content weak_self#weakref.ReferenceType[HTTPResponse]r&