관리-도구
편집 파일: cache.cpython-37.pyc
B ��Re, � @ 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 |krXt�dd� t |��� tS |d }y|| ||dd � � W n2 tk r� } zt�|jd � tS d }~X Y nX 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# ��/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/commands/cache.py�run- s( zCacheCommand.runc C s |rt d��t�|j� d S )NzToo 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 )NzToo many arguments�*zq Location: {location} Size: {size} Number of wheels: {package_count} )�locationZ package_count�size)r �len�_find_wheels�_wheels_cache_dir� filesystem�format_directory_size�textwrap�dedent�format�stripr r )r r r Znum_packagesZcache_locationZ cache_size�messager# r# r$ r V s zCacheCommand.get_cache_infoc C s� t |�dkrtd��|r"|d }nd}| �||�}|sDt�d� d S g }x4|D ],}tj�|�}t� |�}|� d�||�� qNW t�d� t�d�t |��� d S ) Nr zToo many argumentsr r&