JezK
Edit File: rotate.cpython-311.pyc
� ��ft � �n � d dl mZ d dlmZ d dlmZ d dlZd dlZd dlm Z d dl mZ G d� de� � ZdS ) � )�convert_path)�log)�DistutilsOptionErrorN)�six)�Commandc �4 � e Zd ZdZdZg d�Zg Zd� Zd� Zd� Z dS )�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 �0 � d | _ d | _ d | _ d S )N)�match�dist_dir�keep��selfs �L/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/rotate.py�initialize_optionszrotate.initialize_options s � ��� ��� ��� � � � c � � | j �t d� � �| j �t d� � � t | j � � | _ n# t $ r t d� � �w xY wt | j t j � � r)d� | 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 �P � g | ]#}t |� � � � � ��$S � )r �strip)�.0�ps r � <listcomp>z+rotate.finalize_options.<locals>.<listcomp>* s5 � � � � �,-��Q�W�W�Y�Y�'�'�� � r �,�bdist)r r ) r r r �int� ValueError� isinstancer �string_types�split�set_undefined_optionsr s r �finalize_optionszrotate.finalize_options s� � ��:��&�*�� � � �9��&�'M�N�N�N� D��D�I���D�I�I��� D� D� D�&�'B�C�C�C� D�����d�j�#�"2�3�3� �� �15��1A�1A�#�1F�1F�� � �D�J� �"�"�7�,D�E�E�E�E�Es �A �A"c � � | � d� � ddlm} | j D �]"}| j � � � dz |z } |t j � | j |� � � � }d� |D � � }|� � � |� � � t j dt |� � |� � || j d � }|D ]i\ }}t j d|� � | j sHt j � |� � rt# j |� � �Ut j |� � �j��$d S )N�egg_infor )�glob�*c �P � g | ]#}t j � |� � |f��$S r )�os�path�getmtime)r �fs r r zrotate.run.<locals>.<listcomp>6 s- � �=�=�=�!�b�g�&�&�q�)�)�1�-�=�=�=r 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. s r �runz rotate.run/ sE � �����$�$�$��������z� %� %�G��'�0�0�2�2�S�8�7�B�G��D�����d�m�W�=�=�>�>�E�=�=�u�=�=�=�E��J�J�L�L�L��M�M�O�O�O��H�-�s�5�z�z�7�C�C�C��$�)�*�*�%�E�� %� %���A�����*�*�*��|� %��w�}�}�Q�'�'� %�� �a�(�(�(�(�� �!����� %� %� %r N) �__name__� __module__�__qualname__�__doc__�description�user_options�boolean_optionsr r% r? r r r r r sg � � � � � �$�$�F�K�� � �L� �O�� � � F� F� F�$%� %� %� %� %r r ) �distutils.utilr � distutilsr �distutils.errorsr r+ r9 �setuptools.externr � setuptoolsr r r r r �<module>rL s� �� '� '� '� '� '� '� � � � � � � 1� 1� 1� 1� 1� 1� � � � � � � � � !� !� !� !� !� !� � � � � � �6%� 6%� 6%� 6%� 6%�W� 6%� 6%� 6%� 6%� 6%r