ު3=HddlZddlZddlmZddlmZddlmZddlm Z m Z ddl m Z m Z ddlmZddlmZdd lmZeeZGd d eZdS) N)Values)Callable)Command)ERRORSUCCESS) CommandErrorPipError) filesystem) getLogger) format_sizeceZdZdZdZdZddZdeee e e egdfffdZ de d e ede fd Zde d e eddfd Zde d e eddfd Zde d e eddfd Zde eddfdZde eddfdZde d e eddfdZde d e eddfdZde dedefdZde de efdZde dede efdZdS) CacheCommandaw Inspect and manage pip's wheel cache. Subcommands: - dir: Show the cache directory. - info: Show information about the cache. - list: List filenames of packages stored in the cache. - remove: Remove one or more package from the cache. - purge: Remove all items from the cache. ```` can be a glob expression or a package name. Tz %prog dir %prog info %prog list [] [--format=[human, abspath]] %prog remove %prog purge returnNc|jdddddd|jd|jdS) Nz--formatstore list_formathuman)rabspathz:Select the output format among: human (default) or abspath)actiondestdefaultchoiceshelpr)cmd_opts add_optionparserinsert_option_groupselfs |/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/commands/cache.py add_optionszCacheCommand.add_options(sU   (M !    ''4=99999cD|j|j|j|j|jdS)N)dirinfolistremovepurge) get_cache_dirget_cache_infolist_cache_itemsremove_cache_items purge_cachers r handler_mapzCacheCommand.handler_map4s/%')-%    r"optionsargsc|}|js!tdtS|r |d|vrBtddt |tS|d} ||||ddnC#t$r6}t|jdtcYd}~Sd}~wwxYwtS)Nzr)rIrrKrformat_for_humanformat_for_abspath)rr/r0patternfiless r r+zCacheCommand.list_cache_itemss t99q==344 4  1gGGG!!'733  ' ) )  ! !% ( ( ( ( (  # #E * * * * *r"rYc|stddSg}|D]Q}tj|}t j|}|d|d|dRtdtdt|dS)NzNo locally built wheels cached.z - z ()zCache contents:  ) r4r%ospathbasenamer format_file_sizeappendr6r7)rrYresultsfilenamewheelsizes r rVzCacheCommand.format_for_humans  KK9 : : : F 3 3HG$$X..E.x88D NN111$111 2 2 2 2 '((( DIIfWoo../////r"c|r  2 KK &--00 1 1 1 1 1 2 2r"ct|dkrtd|std|||d}d}|ddkr|||z }n|d|ddz }|st|d}|D]M}|t j|jz }t j |t d |Ntj | |d }tj| |d }g||} | D]p} | D]} | d | n#t"$rYnwxYwt d | q| |d} t j| r.t j| t dtdt|t-|tdt| dS)Nr2r;zPlease provide a patternrzNo matching packagesr>z for pattern ""z Removed %sr@rAT) missing_okzselfcheck.jsonz"Removed legacy selfcheck.json filezFiles removed: %s (%s)zDirectories removed: %s)rIrrKrJr4warningr]statst_sizeunlinkverboser subdirs_without_filesrLsubdirs_without_wheelsiterdirrmdirFileNotFoundErrorr^isfiler'r%r ) rr/r0rYno_matching_msg bytes_removedrc http_dirs wheel_dirsdirssubdirfileselfcheck_jsons r r,zCacheCommand.remove_cache_itemssx t99q==344 4 ;9:: :!!'47330 7c>> T**733 3EE :Q::: :O , NN? + + +  3 3H RWX..6 6M Ih    NN< 2 2 2 24T__Wf5U5UVV 6 OOGX . .  )(Z( 1 1F "NN,,11DKK4K0000 $     NN< 0 0 0 02BCC 7>>. ) ) A In % % % NN? @ @ @ ,c%jj+m:T:TUUU -s4yy99999sAF FFcR|rtd||dgS)Nr;r>)rr,r<s r r-zCacheCommand.purge_caches1  5344 4&&w666r"rzcLtj|j|S)N)r]r^r6r3)rr/rzs r rLzCacheCommand._cache_dirsw||G-v666r"c||d}||d}tj|dtj|dzS)Nr@r?r>rLr find_files)rr/ old_http_dir new_http_dirs r rJzCacheCommand._find_http_filessVw77 w :: $\377*:O #; ;   r"rXcn||d}|d|vrdndz}tj||S)NrA-z*.whlz-*.whlr)rr/rX wheel_dirs r rKzCacheCommand._find_wheelss@OOGX66 $wWWHE$Y888r")rN)__name__ __module__ __qualname____doc__ignore_require_venvusager!dictstrrrr&r.intr9r)r*r+rVrWr,r-rLrJrKr"r rrsQ   E : : : : T#xc0CT0I'J"JK    6cs4'V'49''''' (f(DI($((((T + +d3i +D + + + + 0d3i 0D 0 0 0 02S 2d22221:&1:S 1:d1:1:1:1:f767c7t7777 7&7#7#7777  49    9F9S9T#Y999999r"r)r]rOoptparsertypingrpip._internal.cli.base_commandrpip._internal.cli.status_codesrrpip._internal.exceptionsrr pip._internal.utilsr pip._internal.utils.loggingr pip._internal.utils.miscr rr4rrr"r rs 22222299999999;;;;;;;;******111111000000 8  o9o9o9o9o97o9o9o9o9o9r"