Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pip/_internal/commands/__pycache__/cache.cpython-39.pyc
Ðазад
a "�h� � @ s� d dl Z d dlZd dlmZ d dlmZmZ d dlmZ d dl m Z mZ d dlm Z mZ d dlmZ d dlmZ d d lmZ ee�ZG d d� de�ZdS )� N)�Values)�Any�List)�Command)�ERROR�SUCCESS)�CommandError�PipError)� filesystem)� getLogger)�format_sizec @ s e Zd ZdZdZdZdd�dd�Zeee e d�d d �Zeee dd�dd�Z eee dd�d d�Zeee dd�dd�Zee dd�dd�Zee dd�dd�Zeee dd�dd�Zeee dd�dd�Zee e d�dd�Zeee d�dd�Zee 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. ``<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 ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pip/_internal/commands/cache.py�add_options( s � zCacheCommand.add_options)�options�argsr 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 r! r )r r r! �handlersr �er r r �run4 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( T s zCacheCommand.get_cache_dirc C s� |rt d��t| �|��}t| �|d��}| �|d�}| �|d�}| �|d�}t�t�|�t�|� �}t�|�} t � d�j||||||| d��� } t �| � d S )Nr5 �*�http-v2�http�wheelsa Package index page cache location (pip v23.3+): {http_cache_location} Package index page cache location (older pips): {old_http_cache_location} Package index page cache size: {http_cache_size} Number of HTTP files: {num_http_files} Locally built wheels location: {wheels_cache_location} Locally built wheels size: {wheels_cache_size} Number of locally built wheels: {package_count} )�http_cache_location�old_http_cache_location�http_cache_size�num_http_files�wheels_cache_locationZ package_count�wheels_cache_size)r �len�_find_http_files�_find_wheels� _cache_dirr r �directory_size�format_directory_size�textwrap�dedent�format�stripr. r# )r r r! r>