o aidã@s˜ddlZddlZddlmZddlmZmZddlmm m Z ddl m Z ddl mZmZddlmZmZddlmZeeƒZGdd „d e ƒZdS) éN)ÚValues)ÚAnyÚList)ÚCommand)ÚERRORÚSUCCESS)Ú CommandErrorÚPipError)Ú getLoggerc@s0eZdZdZdZdZd#dd„Zded ee de fd d „Z ded ee ddfd d „Z ded ee ddfdd„Zded ee ddfdd„Zdee ddfdd„Zdee ddfdd„Zded ee ddfdd„Zded ee ddfdd„Zdede de fdd„Zdedee fdd„Zded e dee fd!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 ÚreturnNcCs,|jjddddddd|j d|j¡dS) Nz--formatÚstoreÚ list_formatÚhuman)rÚabspathz:Select the output format among: human (default) or abspath)ÚactionÚdestÚdefaultÚchoicesÚhelpr)Úcmd_optsÚ add_optionÚparserÚinsert_option_group)Úself©rúŽ/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/commands/cache.pyÚ add_options'sú zCacheCommand.add_optionsÚoptionsÚargsc Cs¶|j|j|j|j|jdœ}|jst d¡tS|r|d|vr,t dd  t |ƒ¡¡tS|d}z||||dd…ƒWt St yZ}zt |j d¡tWYd}~Sd}~ww)N)ÚdirÚinfoÚlistÚremoveÚpurgezrEr,ÚwarningrNÚunlinkÚverboser!)rrrrKZno_matching_msgrTrrrr)¤s    zCacheCommand.remove_cache_itemscCs|rtdƒ‚| |dg¡S)Nr3r5)rr)r4rrrr*½szCacheCommand.purge_cacheÚsubdircCstj |j|¡S)N)rNrOr.r+)rrrZrrrr@ÃszCacheCommand._cache_dircCs| |d¡}t |d¡S)Nr6r5©r@rAÚ find_files)rrZhttp_dirrrrr>Æs  zCacheCommand._find_http_filesrJcCs,| |d¡}|d|vr dnd}t ||¡S)Nr7ú-z*.whlz-*.whlr[)rrrJÚ wheel_dirrrrr?Ês  zCacheCommand._find_wheels)r N)Ú__name__Ú __module__Ú __qualname__Ú__doc__Úignore_require_venvÚusagerrrÚstrÚintr2rr&r'r(rHrIr)r*r@r>r?rrrrr s    $  r )rNrCÚoptparserÚtypingrrÚpip._internal.utils.filesystemÚ _internalÚutilsrAÚpip._internal.cli.base_commandrÚpip._internal.cli.status_codesrrÚpip._internal.exceptionsrr Úpip._internal.utils.loggingr r_r,r rrrrÚs