R`i d dl mZ d dlZd dlZd dlZd dlmZmZmZm Z d dl mZ d dlm Z d dlmZmZ d dlmZ er d dlmZmZ d d lmZ d d lmZ d dlmZ d dlmZ G d de Zy) )annotationsN) TYPE_CHECKINGAny CollectionMapping)HTTPAdapter) DictCache)PERMANENT_REDIRECT_STATUSESCacheController)CallbackFileWrapper)PreparedRequestResponse)HTTPResponse) BaseCache) BaseHeuristic) Serializerc e Zd Zh dZ d d fd Z d d fd Z d d fd Zd fdZ xZS ) CacheControlAdapter> PUTPATCHDELETEc t | |i | | t n|| _ || _ |xs d| _ |xs t } | | j || | _ y )N)GET)cache_etags serializer)super__init__r cache heuristiccacheable_methodsr controller)selfr r controller_classr r r argskwcontroller_factory __class__s /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/cachecontrol/adapter.pyr zCacheControlAdapter.__init__ s\ $%"%$)MY[u "!2!>h-@,JJKJ c n |xs | j }|j |v rf | j j | } | r| j || d S |j j | j j | t | - |||||| } | S # t j $ r d} Y ww xY w)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" requeststreamtimeoutverifycertproxiesr cacheablecached_responserespr' s r( r4 zCacheControlAdapter.send2 s &?)?)? >>Y& '"&//"@"@"I **7OPT*UU OO""4??#F#Fw#OPw|GVWfdGL :: '"& 's B B43B4c |xs | j }|sA|j |v r2| j r| j j | }|j dk( rG| j j || }||urd}|j d |j |}nt |j t v r| j j || n}t |j t j | j j || |_ |j r-|j" d fd}t% j&