Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
This uploader supports multiple file upload.
Submit
~
lib
python3.9
site-packages
setuptools
command
__pycache__
File Content:
rotate.cpython-39.pyc
a ��khP � @ sT d dl mZ d dlmZ d dlmZ d dlZd dlZd dlm Z G dd� de �Z dS )� )�convert_path)�log)�DistutilsOptionErrorN)�Commandc @ s8 e Zd ZdZdZg d�Zg Zdd� 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 keepc C s d | _ d | _d | _d S )N)�match�dist_dir�keep)�self� r �=/usr/lib/python3.9/site-packages/setuptools/command/rotate.py�initialize_options s zrotate.initialize_optionsc C s� | j d u rtd��| jd u r$td��zt| j�| _W n. tyb } ztd�|�W Y d }~n d }~0 0 t| j t�r�dd� | j �d�D �| _ | �dd� d S ) 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 integerc S s g | ]}t |�� ��qS r )r �strip)�.0�pr r r � <listcomp>( s z+rotate.finalize_options.<locals>.<listcomp>�,Zbdist)r r ) r r r �int� ValueError� isinstance�str�splitZset_undefined_options)r �er r r �finalize_options s � �zrotate.finalize_optionsc C s� | � d� ddlm} | jD ]�}| j�� d | }|tj�| j|��}dd� |D �}|� � |� � t�dt |�|� || jd � }|D ]<\}}t�d|� | js�tj�|�r�t�|� q�t�|� q�qd S ) NZegg_infor )�glob�*c S s g | ]}t j�|�|f�qS r )�os�path�getmtime)r �fr r r r 4 � zrotate.run.<locals>.<listcomp>z%d file(s) matching %szDeleting %s)Zrun_commandr r ZdistributionZget_namer r �joinr �sort�reverser �info�lenr �dry_run�isdir�shutil�rmtree�unlink)r r �pattern�files�tr"