Your IP : 3.147.77.119


Current Path : /opt/alt/python36/lib/python3.6/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/setuptools/command/__pycache__/rotate.cpython-36.pyc

3

K�Ret�@s`ddlmZddlmZddlmZddlZddlZddlm	Z	ddl
mZGdd�de�ZdS)	�)�convert_path)�log)�DistutilsOptionErrorN)�six)�Commandc@s:eZdZdZdZdddgZgZdd
�Zdd�Zdd�Z	dS)�rotatezDelete older distributionsz2delete older distributions, keeping N newest files�match=�m�patterns to match (required)�	dist-dir=�d�%directory where the distributions are�keep=�k�(number of matching distributions to keepcCsd|_d|_d|_dS)N)�match�dist_dir�keep)�self�r��/builddir/build/BUILDROOT/alt-python36-setuptools-38.5.2-7.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/setuptools/command/rotate.py�initialize_optionsszrotate.initialize_optionscCs�|jdkrtd��|jdkr$td��yt|j�|_Wntk
rPtd��YnXt|jtj�rxdd�|jjd�D�|_|j	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|j���qSr)r�strip)�.0�prrr�
<listcomp>+sz+rotate.finalize_options.<locals>.<listcomp>�,�bdistr)rr)
rrr�int�
ValueError�
isinstancer�string_types�split�set_undefined_options)rrrr�finalize_optionss

zrotate.finalize_optionscCs�|jd�ddlm}x�|jD]�}|jj�d|}|tjj|j|��}dd�|D�}|j	�|j
�tjdt
|�|�||jd�}xD|D]<\}}tjd|�|js�tjj|�r�tj|�q�tj|�q�WqWdS)	N�egg_infor)�glob�*cSsg|]}tjj|�|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)rr	r
)rrr
)rrr)
�__name__�
__module__�__qualname__�__doc__�description�user_options�boolean_optionsrr$r<rrrrrsr)
�distutils.utilr�	distutilsr�distutils.errorsrr(r6Zsetuptools.externr�
setuptoolsrrrrrr�<module>s

?>