관리-도구
편집 파일: cache.cpython-36.pyc
3 �Re, � @ s� d dl mZ d dlZd dlZd dlZd dljjjZd dl m Z d dlmZm Z d dlmZmZ d dlmZ er�d dlmZ d dlmZmZ eje�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.tjd� tS | s@|d |krZtjddj t |��� tS |d }y|| ||dd � � W n0 tk r� } ztj|jd � tS d }~X 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-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/cache.py�run- s( zCacheCommand.runc C s |rt d��tj|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| j|d��}| j|�}tj|�}tjd�j|||d�j � }t j|� 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}| j||�}|sDtjd� d S g }x4|D ],}tjj|�}tj |�}|j dj||�� qNW tjd� tjdjt |��� d S ) Nr zToo many argumentsr r&