Your IP : 18.118.30.153


Current Path : /opt/alt/python34/lib/python3.4/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/setuptools/command/__pycache__/rotate.cpython-34.pyc

�
M�Re�@s|ddlZddlZddlmZddlmZddlmZddlmZddl	TGdd�de�Z
dS)	�N)�Command)�
basestring)�convert_path)�log)�*c@sUeZdZdZdZdddgZgZd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�4/tmp/pip-l4uy7dan-build/setuptools/command/rotate.py�initialize_optionss		zrotate.initialize_optionscCs�|jdkrtd��n|jdkr<td��nyt|j�|_Wntk
rrtd��YnXt|jt�r�dd�|jjd�D�|_n|jdd	�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 integercSs"g|]}t|j���qSr)r�strip)�.0�prrr�
<listcomp>'s	z+rotate.finalize_options.<locals>.<listcomp>�,�bdistr)�dist_dirr)	r�DistutilsOptionErrorr�int�
ValueError�
isinstancer�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�}x=|D]5\}}tjd|�|js�tj|�q�q�Wq'WdS)	N�egg_infor)�globrcSs(g|]}tjj|�|f�qSr)�os�path�getmtime)r�frrrr1s	zrotate.run.<locals>.<listcomp>z%d file(s) matching %szDeleting %s)�run_commandr'r�distribution�get_namer(r)�joinr�sort�reverser�info�lenr�dry_run�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%r9rrrrrs	r)�	distutilsr(�
setuptoolsrZsetuptools.compatr�distutils.utilrr�distutils.errorsrrrrr�<module>s


?>