/opt/alt/python38/lib/python3.8/site-packages/setuptools/command/__pycache__
Edit: /opt/alt/python38/lib/python3.8/site-packages/setuptools/command/__pycache__/rotate.cpython-38.pyc (2484B)
U
š’aP ã @ sT d dl mZ d dlmZ d dlmZ d dlZd dlZd dlm Z G dd„ de ƒZ
dS )é )Úconvert_path)Úlog)ÚDistutilsOptionErrorN)ÚCommandc @ s: e Zd ZdZdZdddgZg Zdd„ Zdd „ Zd
d„ 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 C s d | _ d | _d | _d S )N)ÚmatchÚdist_dirÚkeep)Úself© r úA/tmp/pip-install-7tp5dx2w/setuptools/setuptools/command/rotate.pyÚinitialize_options s zrotate.initialize_optionsc
C s– | j d krtdƒ‚| jd kr$tdƒ‚zt| jƒ| _W n, tk
r` } ztdƒ|‚W 5 d }~X Y nX 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 Ú
( s z+rotate.finalize_options..ú,Úbdist)r r ) r
r r ÚintÚ
ValueErrorÚ
isinstanceÚstrÚsplitÚset_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 ) NÚegg_infor )ÚglobÚ*c S s g | ]}t j |¡|f‘qS r )ÚosÚpathÚgetmtime)r Úfr r r r 4 s zrotate.run..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% r r r Úrun- s
z
rotate.runN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚuser_optionsÚboolean_optionsr r r6 r r r r r
s ýr )Údistutils.utilr Ú distutilsr Údistutils.errorsr r" r0 Ú
setuptoolsr r r r r r Ú s