OwlCyberSecurity - MANAGER
Edit File: cache.cpython-312.pyc
� ���g� � � � 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� Z G d � de� Zy)� N)�Values)�Any�List)�Command)�ERROR�SUCCESS)�CommandError�PipError)� filesystem)� getLogger)�format_sizec �, � e Zd ZdZdZdZdd�Zdedee de fd �Zdedee ddfd �Z dedee ddfd�Zdedee ddfd�Zd ee ddfd�Zd ee ddfd�Zdedee ddfd�Zdedee ddfd�Zdede de fd�Zdedee fd�Zdede dee fd�Zy)�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 �returnNc � � | j j dddddd�� | j j d| j � y ) 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)�selfs �K/opt/hc_python/lib/python3.12/site-packages/pip/_internal/commands/cache.py�add_optionszCacheCommand.add_options( sE � �� � � � �����(�M� !� � ���'�'��4�=�=�9� �options�argsc �� � | j | j | j | j | j d�}|j st j d� t S |r|d |vr4t j ddj t |� � � t S |d } || ||dd � t S # t $ r2}t j |j d � t cY d }~S d }~ww xY w)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 �es r �runzCacheCommand.run4 s� � ��%�%��'�'��)�)��-�-��%�%� �� � � ��L�L�W�X��L� �t�A�w�h�.��L�L�1�� � �&��*�+� � �L��a��� ��H�V��W�d�1�2�h�/� ��� � ��L�L������#��L�� �s �%B: �: C5�'C0�*C5�0C5c �\ � |rt d� �t j |j � y )N�Too many arguments)r r2 r'