관리-도구
편집 파일: adapter.cpython-38.pyc
U ʗRe� � @ s` d dl Z d dlZd dlZd dlmZ ddlmZmZ ddlm Z ddl mZ G dd� de�ZdS ) � N)�HTTPAdapter� )�CacheController�PERMANENT_REDIRECT_STATUSES)� DictCache)�CallbackFileWrapperc sP e Zd ZdddhZd� fdd� Zd� fdd � Zd� fdd� Z� fd d�Z� ZS )�CacheControlAdapter�PUT�PATCH�DELETENTc sT t t| �j||� |d kr t� n|| _|| _|p2d| _|p<t} | | j||d�| _d S )N)�GET)�cache_etags� serializer) �superr �__init__r �cache� heuristic�cacheable_methodsr � controller) �selfr r �controller_classr r r �args�kw�controller_factory�� __class__� ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/adapter.pyr s �zCacheControlAdapter.__init__c s� |p| j }|j|krhz| j�|�}W n tjk r> d}Y nX |rT| j||dd�S |j�| j� |�� t t| �j|f|�}|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 r �send)r �requestr r � cacheable�cached_response�respr r r r'