/usr/lib/python3/dist-packages/setuptools/command/__pycache__
Edit: /usr/lib/python3/dist-packages/setuptools/command/__pycache__/rotate.cpython-310.pyc (2476B)
o
ƒ_¶aP ã @ 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/dist-packages/setuptools/command/rotate.pyÚinitialize_options s
zrotate.initialize_optionsc
C sŒ | j d u r tdƒ‚| jd u rtdƒ‚zt| jƒ| _W n ty+ } ztdƒ|‚d }~ww 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 ]U}| j ¡ d | }|tj | j|¡ƒ}dd„ |D ƒ}| ¡ |
¡ t dt
|ƒ|¡ || jd … }|D ]\}}t d|¡ | jsbtj |¡r]t |¡ qDt |¡ qDqd 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&