?@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 n/builddir/build/BUILD/cloudlinux-venv-1.0.10/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"cXt|dkrtd|std|||d}d}|ddkr|||z }n|d|ddz }|st|d}|D]M}|t j|jz }t j |t d |Nt d t|t|dS) Nr2r;zPlease provide a patternrzNo matching packagesr>z for pattern ""z Removed %szFiles removed: %s (%s)) rIrrKrJr4warningr]statst_sizeunlinkverboser%r )rr/r0rYno_matching_msg bytes_removedrcs r r,zCacheCommand.remove_cache_itemss/ t99q==344 4 ;9:: :!!'47330 7c>> T**733 3EE :Q::: :O , NN? + + +  3 3H RWX..6 6M Ih    NN< 2 2 2 2 ,c%jj+m:T:TUUUUUr"cR|rtd||dgS)Nr;r>)rr,r<s r r-zCacheCommand.purge_caches1  5344 4&&w666r"subdircLtj|j|S)N)r]r^r6r3)rr/rqs 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-*.whlrt)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 rrsW   E : : : : T#xc0CT0I'J"JK    6cs4'V'49''''' (f(DI($((((T + +d3i +D + + + + 0d3i 0D 0 0 0 02S 2d2222V&VS VdVVVV6767c7t7777 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 r{r4rrr"r rs 22222299999999;;;;;;;;******111111000000 8  W9W9W9W9W97W9W9W9W9W9r"