3 igd@sddlZddlZddlmZddlmZmZddljj j 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,|jjddddd dd|jjd|jdS) Nz--formatstore list_formathumanabspathz:Select the output format among: human (default) or abspath)actiondestdefaultchoiceshelpr)rr)cmd_opts add_optionparserinsert_option_group)selfr;/tmp/pip-build-88gy_88q/pip/pip/_internal/commands/cache.py add_options'szCacheCommand.add_options)optionsargsr cCs|j|j|j|j|jd}|js.tjdtS| s@|d|krZtjddj t |tS|d}y||||ddWn0t k r}ztj|j dtSd}~XnXt S)N)dirinfolistremovepurgezszCacheCommand._cache_dir)rr cCs|j|d}tj|dS)Nr4r3)r>r? find_files)rrZhttp_dirrrrr<s zCacheCommand._find_http_files)rrGr cCs,|j|d}|d|krdnd}tj||S)Nr5-z*.whlz-*.whl)r>r?rW)rrrG wheel_dirrrrr=s zCacheCommand._find_wheels)__name__ __module__ __qualname____doc__Zignore_require_venvusagerrrstrintr2rr&r'r(rErFr)r*r>r<r=rrrrr s   $  r )rKr@optparserZtypingrrZpip._internal.utils.filesystemZ _internalutilsr?Zpip._internal.cli.base_commandrZpip._internal.cli.status_codesrrZpip._internal.exceptionsrr Zpip._internal.utils.loggingr rZr,r rrrrs