Your IP : 3.15.18.73


Current Path : /opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__pycache__/rotate.cpython-37.pyc

B

��ReP�@sTddlmZddlmZddlmZddlZddlZddlm	Z	Gdd�de	�Z
dS)�)�convert_path)�log)�DistutilsOptionErrorN)�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��/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/rotate.py�initialize_optionsszrotate.initialize_optionsc
Cs�|jdkrtd��|jdkr$td��yt|j�|_Wn,tk
r`}ztd�|�Wdd}~XYnXt|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>)sz+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}x�|jD]�}|j��d|}|tj�|j|��}dd�|D�}|�	�|�
�t�dt
|�|�||jd�}xD|D]<\}}t�d|�|js�tj�|�r�t�|�q�t�|�q�WqWdS)	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
sr)�distutils.utilr�	distutilsr�distutils.errorsrr"r0�
setuptoolsrrrrrr�<module>s

?>