403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.6/site-packages/pip/_internal/commands/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.6/site-packages/pip/_internal/commands/__pycache__/cache.cpython-36.pyc
3

�N�ad�@s�ddlZddlZddlmZddlmZmZddljj	j
Z
ddlmZddl
mZmZddlmZmZddlmZee�ZGdd	�d	e�ZdS)
�N)�Values)�Any�List)�Command)�ERROR�SUCCESS)�CommandError�PipError)�	getLoggerc@seZdZdZdZdZdd�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)�returncCs,|jjddddd	dd�|jjd|j�dS)
Nz--format�store�list_format�human�abspathz:Select the output format among: human (default) or abspath)�action�dest�default�choices�helpr)rr)Zcmd_optsZ
add_option�parserZinsert_option_group)�self�r�/usr/lib/python3.6/cache.py�add_options'szCacheCommand.add_options)�options�argsrcCs�|j|j|j|j|jd�}|js.tjd�tS|s@|d|krZtjddj	t
|���tS|d}y||||dd��Wn0tk
r�}ztj|jd�tSd}~XnXt
S)N)�dir�info�list�remove�purgez<pip cache commands can not function since cache is disabled.rzNeed 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	rr)rrrZhandlersr�errr�run4s(

zCacheCommand.runcCs|rtd��tj|j�dS)NzToo many arguments)rr)rr()rrrrrrr#TszCacheCommand.get_cache_dirc
Cs�|rtd��t|j|��}t|j|d��}|j|d�}|j|d�}tj|�}tj|�}tjd�j	||||||d�j
�}	tj|	�dS)NzToo many arguments�*�http�wheelsa�
                    Package index page cache location: {http_cache_location}
                    Package index page cache size: {http_cache_size}
                    Number of HTTP files: {num_http_files}
                    Wheels location: {wheels_cache_location}
                    Wheels size: {wheels_cache_size}
                    Number of wheels: {package_count}
                )�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_dir�
filesystemZformat_directory_size�textwrap�dedent�format�stripr)r)
rrrr4Znum_packagesr2r5r3r6�messagerrrr$Zs"

zCacheCommand.get_cache_infocCsVt|�dkrtd��|r"|d}nd}|j||�}|jdkrH|j|�n
|j|�dS)Nr"zToo many argumentsrr/r)r7rr9r�format_for_human�format_for_abspath)rrr�pattern�filesrrrr%~s

zCacheCommand.list_cache_items)rDrcCst|stjd�dSg}x:|D]2}tjj|�}tj|�}|jd|�d|�d��qWtjd�tjdjt	|���dS)NzNothing cached.z - z (�)zCache contents:
�
)
r)r�os�path�basenamer;Zformat_file_size�appendr+r,)rrD�results�filenameZwheel�sizerrrrA�s



zCacheCommand.format_for_humancCs<|sdSg}x|D]}|j|�qWtjdjt|���dS)NrF)rJr)rr+r,)rrDrKrLrrrrB�s
zCacheCommand.format_for_abspathcCs�t|�dkrtd��|s td��|j||d�}d}|ddkrP||j|�7}n|dj|d�7}|sptj|�x"|D]}tj|�tj	d|�qvWtj
d	t|��dS)
Nr"zToo many argumentszPlease provide a patternrzNo matching packagesr/z for pattern "{}"z
Removed %szFiles removed: %s)r7rr9r8r>r)ZwarningrG�unlink�verboser)rrrrDZno_matching_msgrLrrrr&�s


zCacheCommand.remove_cache_itemscCs|rtd��|j|dg�S)NzToo many argumentsr/)rr&)rrrrrrr'�szCacheCommand.purge_cache)r�subdirrcCstjj|j|�S)N)rGrHr+r()rrrPrrrr:�szCacheCommand._cache_dir)rrcCs|j|d�}tj|d�S)Nr0r/)r:r;�
find_files)rrZhttp_dirrrrr8�szCacheCommand._find_http_files)rrCrcCs,|j|d�}|d|krdnd}tj||�S)Nr1�-z*.whlz-*.whl)r:r;rQ)rrrCZ	wheel_dirrrrr9�szCacheCommand._find_wheels)�__name__�
__module__�__qualname__�__doc__Zignore_require_venv�usagerrr�str�intr.rr#r$r%rArBr&r'r:r8r9rrrrrs

 $

r)rGr<ZoptparserZtypingrrZpip._internal.utils.filesystemZ	_internalZutilsr;Zpip._internal.cli.base_commandrZpip._internal.cli.status_codesrrZpip._internal.exceptionsrr	Zpip._internal.utils.loggingr
rSr)rrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit