Hacked By AnonymousFox

Current Path : /opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__pycache__/rotate.cpython-310.pyc

o

~�ReP�@sTddlmZddlmZddlmZddlZddlZddlm	Z	Gdd�de	�Z
dS)�)�convert_path)�log)�DistutilsOptionErrorN)�Commandc@s8eZdZdZdZgd�ZgZdd�Zdd�Zdd	�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��/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/rotate.py�initialize_optionss
zrotate.initialize_optionsc
Cs�|jdur	td��|jdurtd��zt|j�|_Wnty+}ztd�|�d}~wwt|jt�r>dd�|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>(s�z+rotate.finalize_options.<locals>.<listcomp>�,�bdist)rr)	r
rr�int�
ValueError�
isinstance�str�split�set_undefined_options)r
�errr�finalize_optionss"
�

��
�zrotate.finalize_optionscCs�|�d�ddlm}|jD]U}|j��d|}|tj�|j|��}dd�|D�}|�	�|�
�t�dt
|�|�||jd�}|D]\}}t�d|�|jsbtj�|�r]t�|�qDt�|�qDqdS)	N�egg_infor)�glob�*cSsg|]
}tj�|�|f�qSr)�os�path�getmtime)r�frrrr4szrotate.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)r
r �pattern�files�tr%rrr�run-s&


���z
rotate.runN)
�__name__�
__module__�__qualname__�__doc__�description�user_options�boolean_optionsrrr6rrrrr
sr)�distutils.utilr�	distutilsr�distutils.errorsrr"r0�
setuptoolsrrrrrr�<module>s

Hacked By AnonymousFox1.0, Coded By AnonymousFox