U ja@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 dZ eee ddddZeeddddZeeddddZeee ddddZeee ddddZeeedddZeeedddZeeeed 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)selfrt/private/var/folders/k6/_7fsz4ts3b78x3b3xwrxjh_c8s8xv7/T/pip-unpacked-wheel-bug3gbve/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)dirinfolistremovepurgezrNunlinkr,verboser!)rrrrKrTrrrr)s   zCacheCommand.remove_cache_itemscCs|r td||dgS)Nr3r5)rr)r4rrrr*szCacheCommand.purge_cache)rsubdirr cCstj|j|S)N)rNrOr.r+)rrrYrrrr@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-*.whlrZ)rrrJ wheel_dirrrrr?s zCacheCommand._find_wheels)__name__ __module__ __qualname____doc__ignore_require_venvusagerrrrintr2r&r'r(strrHrIr)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