xՉq}+ j d dl Z d dlZd dlZd dlmZ ddlmZ ddlmZ ddl m Z G d de ZdS ) N)HTTPAdapter )CacheController) DictCache)CallbackFileWrapperc X e Zd ZddhZ d fd Zd fd Z d fd Z fd Z xZS ) CacheControlAdapterPUTDELETENTc t t | j |i | |t n|| _ || _ |pd| _ |pt } | | j || | _ d S )N)GET)cache_etags serializer) superr __init__r cache heuristiccacheable_methodsr controller)selfr r controller_classr r r argskwcontroller_factory __class__s /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/adapter.pyr zCacheControlAdapter.__init__ s 2!4((14>2>>>$)MY[[[u "!2!>h-@,,JKJ c l |p| j }|j |v r | j | }n# t j $ r d}Y nw xY w|r| ||d S |j | j | t t | j |fi |}|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 r send)r requestr r cacheablecached_responserespr s r r( zCacheControlAdapter.send$ s &?)? >Y&& '"&/"@"@"I"I: ' ' '"& ' V**7OPT*UUU O""4?#F#Fw#O#OPPP4u($//4WCCCCs 0 AAFc > |p| j }|s|j |v r| j r| j | }|j dk rN| j || }||urd}| d | |}n|j dk r| j || net |j t j | j j || |_ |j r&|j fd}t! j || |_ t% t&