<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    .e                     @   s   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ ddlmZ erhdd	lmZ ed
d ZG dd deZdS )zHTTP cache implementation.
    N)contextmanager)	BaseCache)	FileCache)adjacent_tmp_filereplace)
ensure_dir)MYPY_CHECK_RUNNING)Optionalc                	   c   s(   z
dV  W n t tfk
r"   Y nX dS )zvIf we can't access the cache then we can just skip caching and process
    requests as if caching wasn't enabled.
    N)OSErrorIOError r   r   ?/usr/lib/python3.8/site-packages/pip/_internal/network/cache.pysuppressed_cache_errors   s    
r   c                       s@   e Zd ZdZ fddZdd Zdd Zdd	 Zd
d Z  Z	S )SafeFileCachezw
    A file based cache which is safe to use even when the target directory may
    not be accessible or writable.
    c                    s(   |d k	st dtt|   || _d S )Nz!Cache directory must not be None.)AssertionErrorsuperr   __init__	directory)selfr   	__class__r   r   r   &   s    zSafeFileCache.__init__c                 C   s4   t |}t|d d |g }tjj| jf| S )N   )r   encodelistospathjoinr   )r   nameZhashedpartsr   r   r   _get_cache_path,   s    
zSafeFileCache._get_cache_pathc                 C   sR   |  |}t 8 t|d"}| W  5 Q R  W  5 Q R  S Q R X W 5 Q R X d S )Nrb)r   r   openread)r   keyr   fr   r   r   get5   s    
zSafeFileCache.getc              
   C   sZ   |  |}t @ ttj| t|}|| W 5 Q R X t|j	| W 5 Q R X d S N)
r   r   r   r   r   dirnamer   writer   r   )r   r#   valuer   r$   r   r   r   set<   s    

zSafeFileCache.setc              	   C   s*   |  |}t  t| W 5 Q R X d S r&   )r   r   r   remove)r   r#   r   r   r   r   deleteG   s    
zSafeFileCache.delete)
__name__
__module____qualname____doc__r   r   r%   r*   r,   __classcell__r   r   r   r   r       s   	r   )r0   r   
contextlibr   Zpip._vendor.cachecontrol.cacher   Zpip._vendor.cachecontrol.cachesr   Zpip._internal.utils.filesystemr   r   Zpip._internal.utils.miscr   Zpip._internal.utils.typingr   typingr	   r   r   r   r   r   r   <module>   s   

