U ʗRe@sddlZddlZddlmZddlmZmZddlmm m Z ddl m Z ddl mZmZddlmZmZddlmZeeZGdd d e ZdS) N)Values)AnyList)Command)ERRORSUCCESS) CommandErrorPipError) getLoggerc@seZdZdZdZdZddddZeee e dd d Z eee ddd d Z eee ddd dZeee ddddZee ddddZee ddddZeee ddddZeee ddddZee e dddZeee dddZee ee d d!d"ZdS)# 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 N)returncCs,|jjddddddd|jd|jdS) Nz--formatstore list_formathuman)rabspathz:Select the output format among: human (default) or abspath)actiondestdefaultchoiceshelpr)cmd_opts add_optionparserinsert_option_group)selfr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/commands/cache.py add_options's zCacheCommand.add_options)optionsargsr c Cs|j|j|j|j|jd}|js.tdtS|r>|d|krXtdd t |tS|d}z||||ddWn:t k r}zt|j dtWYSd}~XYnXt S)N)dirinfolistremovepurgezrEr,warningrNunlinkverboser!)rrrrKZno_matching_msgrTrrrr)s    zCacheCommand.remove_cache_itemscCs|r td||dgS)Nr3r5)rr)r4rrrr*szCacheCommand.purge_cache)rsubdirr cCstj|j|S)N)rNrOr.r+)rrrZrrrr@szCacheCommand._cache_dir)rr cCs||d}t|dS)Nr6r5r@rA find_files)rrZhttp_dirrrrr>s zCacheCommand._find_http_files)rrJr cCs,||d}|d|krdnd}t||S)Nr7-z*.whlz-*.whlr[)rrrJ wheel_dirrrrr?s zCacheCommand._find_wheels)__name__ __module__ __qualname____doc__ignore_require_venvusagerrrstrintr2rr&r'r(rHrIr)r*r@r>r?rrrrr s  $  r )rNrCoptparsertypingrrpip._internal.utils.filesystem _internalutilsrApip._internal.cli.base_commandrpip._internal.cli.status_codesrrpip._internal.exceptionsrr pip._internal.utils.loggingr r_r,r rrrrs