HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/site-packages/setuptools/command/__pycache__/rotate.cpython-38.pyc
U

�i�_t�@s`ddlmZddlmZddlmZddlZddlZddlm	Z	ddl
mZGdd�de�ZdS)	�)�convert_path)�log)�DistutilsOptionErrorN)�six)�Commandc@s:eZdZdZdZdddgZgZdd�Zdd	�Zd
d�Z	dS)
�rotatezDelete older distributionsz2delete older distributions, keeping N newest files)zmatch=�mzpatterns to match (required))z	dist-dir=�dz%directory where the distributions are)zkeep=�kz(number of matching distributions to keepcCsd|_d|_d|_dS)N)�match�dist_dir�keep��self�r�=/tmp/pip-unpacked-wheel-tlqm5ymo/setuptools/command/rotate.py�initialize_optionsszrotate.initialize_optionscCs�|jdkrtd��|jdkr$td��zt|j�|_Wntk
rPtd��YnXt|jtj�rxdd�|j�d�D�|_|�	dd�dS)	NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|����qSr)r�strip)�.0�prrr�
<listcomp>*sz+rotate.finalize_options.<locals>.<listcomp>�,�bdist)rr)
rrr
�int�
ValueError�
isinstancer�string_types�split�set_undefined_optionsrrrr�finalize_optionss
�

�zrotate.finalize_optionscCs�|�d�ddlm}|jD]�}|j��d|}|tj�|j|��}dd�|D�}|�	�|�
�t�dt
|�|�||jd�}|D]<\}}t�d|�|js�tj�|�r�t�|�q�t�|�q�qdS)	N�egg_infor)�glob�*cSsg|]}tj�|�|f�qSr)�os�path�getmtime)r�frrrr6szrotate.run.<locals>.<listcomp>z%d file(s) matching %szDeleting %s)�run_commandr!r�distribution�get_namer#r$�joinr�sort�reverser�info�lenr
�dry_run�isdir�shutil�rmtree�unlink)rr!�pattern�files�tr&rrr�run/s 

z
rotate.runN)
�__name__�
__module__�__qualname__�__doc__�description�user_options�boolean_optionsrrr7rrrrrs�r)
�distutils.utilr�	distutilsr�distutils.errorsrr#r1Zsetuptools.externr�
setuptoolsrrrrrr�<module>s