Re9ddlZddlZddlmZddlmZddlmZ en#e $re e fZYnwxYwdZ GddeZ d ZdS) N)dedent) BaseCache)CacheControllerctj}|tjtjzz}t tdr|tjz}t tdr|tjz} tj|n#ttf$rYnwxYwtj |||} tj |dS#tj |xYw)N O_NOFOLLOWO_BINARYwb) osO_WRONLYO_CREATO_EXCLhasattrrr removeIOErrorOSErroropenfdopenclose)filenamefmodeflagsfds /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py_secure_open_writers KE  RZ") ##Er<   r:   ( W       5% ( (ByT"""   s2BBB5C C!cNeZdZ d dZedZdZdZd Zd Z dS) FileCacheFNc||td ddlm}ddlm}|r|}n1||}n,#t $rt d} t | wxYw||_||_||_ ||_ ||_ dS)Nz/Cannot use use_dir_lock and lock_class togetherr)LockFile) MkdirLockFilez NOTE: In order to use the FileCache you must have lockfile installed. You can install it via pip: pip install lockfile ) ValueErrorlockfiler!lockfile.mkdirlockfiler" ImportErrorr directoryforeverfilemodedirmode lock_class) selfr'r(r)r* use_dir_lockr+r!r"notices r__init__zFileCache.__init__:s  # (>NOO O & ) ) ) ) ) ) < < < < < < &* #%  & & &Ff%% % &"#    $s +)Acrtj|SN)hashlibsha224encode hexdigest)xs rr4zFileCache.encodeas&~ahhjj))33555c||}t|dd|gz}tjj|jg|RS)N)r4listr pathjoinr')r,namehashedpartss r_fnz FileCache._fnesMT""VBQBZ  F8+w|DN3U3333r7c||} t|d5}|cdddS#1swxYwYdS#t$rYdSwxYw)Nrb)r@rreadFileNotFoundError)r,keyr=fhs rgetz FileCache.getlsxx}} dD!! !Rwwyy ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !!   44 s3AA AA  AA A A#"A#c||} tjtj||jn#t tf$rYnwxYw||5}t|j|j 5}| |dddn #1swxYwYddddS#1swxYwYdSr1) r@r makedirsr;dirnamer*rrr+rr)write)r,rEvaluer=lockrFs rsetz FileCache.setusJxx}}  K--t| < < < <!    D __T " " d#DIt}==                                  sG7AA#"A#;CB8, C8B< <C?B< CCCc||}|js( tj|dS#t$rYdSwxYwdSr1)r@r(r rrD)r,rEr=s rdeletezFileCache.deletes]xx}}|   $$      s4 AA)FrrNN) __name__ __module__ __qualname__r/ staticmethodr4r@rGrNrPr7rrr8s %%%%%%%%N66\6444    r7rcTtj|}||S)z\Return the file cache path based on the URL. This does not ensure the file exists! )r cache_urlr@)url filecacherEs rurl_to_file_pathrZs&  #C ( (C ==  r7)r2r textwraprcacher controllerrrD NameErrorrrrrrZrUr7rr_s ((((((++++ '*+ &&&RQQQQQ QQQhs  ++