/usr/local/lib/python3.9/site-packages/pip/_internal/commands/__pycache__
a ���h& � @ s� d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z d dlmZm Z d dlmZ d dlmZ d d lmZ ee�ZG d d� de�ZdS )� N)�Values)�Callable)�Command)�ERROR�SUCCESS)�CommandError�PipError)� filesystem)� getLogger)�format_sizec @ s4 e Zd ZdZdZdZdd�dd�Zeee e ee gdf f d�dd �Ze ee e d �dd�Ze ee dd �d d�Ze ee dd �dd�Ze ee dd �dd�Zee dd�dd�Zee dd�dd�Ze ee dd �dd�Ze ee dd �dd�Ze eed�dd�Ze ee d�d d!�Ze eee 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. ``<pattern>`` can be a glob expression or a package name. Tz� %prog dir %prog info %prog list [<pattern>] [--format=[human, abspath]] %prog remove <pattern> %prog purge N)�returnc C s, | j jddddddd� | j�d| j � d S ) 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 �F/usr/local/lib/python3.9/site-packages/pip/_internal/commands/cache.py�add_options( s � zCacheCommand.add_optionsc C s | j | j| j| j| jd�S )N)�dir�info�list�remove�purge)� get_cache_dir�get_cache_info�list_cache_items�remove_cache_items�purge_cacher r r r �handler_map4 s �zCacheCommand.handler_map)�options�argsr c C s� | � � }|jst�d� tS |r,|d |vrFt�dd�t|��� tS |d }z|| ||dd � � W n8 ty� } z t�|jd � tW Y d }~S d }~0 0 t S )Nz<pip cache commands can not function since cache is disabled.r zNeed an action (%s) to perform.z, � ) r* � cache_dir�logger�errorr �join�sortedr r, r )r r+ r, r* r �er r r �run= s"