JdPbddlmZddlmZddlmZddlZddlZddlm Z Gdde Z dS)) convert_path)log)DistutilsOptionErrorN)Commandc4eZdZdZdZgdZgZdZdZdZ 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 keepc0d|_d|_d|_dS)N)matchdist_dirkeep)selfs L/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/rotate.pyinitialize_optionszrotate.initialize_optionss   c|jtd|jtd t|j|_n"#t$r}td|d}~wwxYwt |jt r)d|jdD|_|dddS)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 integercPg|]#}t|$S)rstrip).0ps r z+rotate.finalize_options..(s5,- QWWYY''r,bdist)rr) r rrint ValueError isinstancestrsplitset_undefined_options)res rfinalize_optionszrotate.finalize_optionss : &*  9 &'MNN N KDIDII K K K&'BCC J K dj# & & 151A1A#1F1FDJ ""7,DEEEEEsA A'A""A'c|dddlm}|jD]"}|jdz|z}|t j|j|}d|D}| | tj dt||||jd}|D]i\}}tj d||jsHt j|rt#j|Ut j|j$dS)Negg_infor)glob*cPg|]#}tj||f$Sr)ospathgetmtime)rfs rrzrotate.run..4s-===!bg&&q))1-===rz%d file(s) matching %sz Deleting %s) run_commandr'r distributionget_namer*r+joinrsortreverserinfolenrdry_runisdirshutilrmtreeunlink)rr'patternfilestr-s rrunz rotate.run-sE $$$z % %G'0022S87BGDdmW==>>E==u===E JJLLL MMOOO H-s5zz7 C C C$)**%E % %A***|%w}}Q''% a(((( !  % % %rN) __name__ __module__ __qualname____doc__ description user_optionsboolean_optionsrr$r>rrrrr sg$$FKL O FFF$%%%%%rr) distutils.utilr distutilsrdistutils.errorsrr*r8 setuptoolsrrrrrrJs''''''111111 6%6%6%6%6%W6%6%6%6%6%r