zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
U
G=®d€ã@s`ddlmZddlmZddlmZddlZddlZddlm    Z    ddl
m Z Gdd„de ƒZ dS)    é)Ú convert_path)Úlog)ÚDistutilsOptionErrorN)Úsix)ÚCommandc@s:eZdZdZdZdddgZgZdd„Zdd    „Zd
d „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 keepcCsd|_d|_d|_dS)N)ÚmatchÚdist_dirÚkeep)Úself©rúPD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/command/rotate.pyÚinitialize_optionsszrotate.initialize_optionsc
Cs˜|jdkrtdƒ‚|jdkr$tdƒ‚zt|jƒ|_Wn,tk
r`}ztdƒ|‚W5d}~XYnXt|jtjƒrˆdd„|j d¡Dƒ|_|     dd¡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 integercSsg|]}t| ¡ƒ‘qSr)rÚstrip)Ú.0ÚprrrÚ
<listcomp>*sz+rotate.finalize_options.<locals>.<listcomp>ú,Úbdist)r r )
r rr ÚintÚ
ValueErrorÚ
isinstancerÚ string_typesÚsplitÚset_undefined_options)rÚerrrÚfinalize_optionss
ÿ
 
ÿzrotate.finalize_optionscCsÌ| d¡ddlm}|jD]ª}|j ¡d|}|tj |j|¡ƒ}dd„|Dƒ}|     ¡| 
¡t   dt |ƒ|¡||jd…}|D]<\}}t   d|¡|jsˆtj |¡rºt |¡qˆt |¡qˆqdS)    NÚegg_infor)ÚglobÚ*cSsg|]}tj |¡|f‘qSr)ÚosÚpathÚgetmtime)rÚfrrrr6szrotate.run.<locals>.<listcomp>z%d file(s) matching %sz Deleting %s)Ú run_commandr!r Ú distributionÚget_namer#r$Újoinr ÚsortÚreverserÚinfoÚlenr Údry_runÚisdirÚshutilÚrmtreeÚunlink)rr!ÚpatternÚfilesÚtr&rrrÚrun/s 
 
    z
rotate.runN)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú descriptionÚ user_optionsÚboolean_optionsrrr7rrrrr sýr) Údistutils.utilrÚ    distutilsrÚdistutils.errorsrr#r1Zsetuptools.externrÚ
setuptoolsrrrrrrÚ<module>s