File: //usr/lib/python3.9/site-packages/pip/_internal/commands/__pycache__/cache.cpython-39.pyc
a
?�f, � @ s� d dl mZ d dlZd dlZd dlZd dlm m mZ d dl m
Z
d dlmZm
Z
d dlmZmZ d dlmZ er�d dlmZ d dlmZmZ e�e�ZG d d
� d
e
�ZdS )� )�absolute_importN)�Command)�ERROR�SUCCESS)�CommandError�PipError)�MYPY_CHECK_RUNNING)�Values)�Any�Listc @ sX e Zd ZdZdZdZdd� Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zdd� Zdd� Z
dS )�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>]
%prog remove <pattern>
%prog purge
c
C s� | j | j| j| j| jd�}|js.t�d� tS |r>|d |vrXt�dd� t
|��� tS |d }z|| ||dd � � W n8 ty� } z t�|jd � tW Y d }~S d }~0 0 t
S )N)�dir�info�list�remove�purgez<pip cache commands can not function since cache is disabled.r zNeed an action (%s) to perform.z, � )�
get_cache_dir�get_cache_info�list_cache_items�remove_cache_items�purge_cache� cache_dir�logger�errorr �join�sortedr �argsr )�self�optionsr �handlers�action�e� r# �@/usr/lib/python3.9/site-packages/pip/_internal/commands/cache.py�run- s, �
�zCacheCommand.runc C s |rt d��t�|j� d S )N�Too many arguments)r r r r �r r r r# r# r$ r O s zCacheCommand.get_cache_dirc C sX |rt d��t| �|d��}| �|�}t�|�}t�d�j|||d�� � }t
�|� d S )Nr&