LsL~QvddlmZddlZddlmZddlmZmZddlm Z ddl m Z ddl m Z Gd d eZdS) ) annotationsN)ClassVar)Command_shutil)log)DistutilsOptionError) convert_pathcDeZdZUdZdZgdZgZded<dZd d Z d 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 keepzClassVar[list[str]]boolean_optionsc0d|_d|_d|_dS)N)matchdist_dirkeep)selfs k/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/setuptools/command/rotate.pyinitialize_optionszrotate.initialize_optionss   returnNonec|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)r strip).0ps r z+rotate.finalize_options..+s(QQQa,qwwyy11QQQr,bdist)rr) rr rint ValueError isinstancestrsplitset_undefined_options)res rfinalize_optionszrotate.finalize_optionss : &*  9 &'MNN N KDIDII K K K&'BCC J K dj# & & RQQ4:;K;KC;P;PQQQDJ ""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 rr!zrotate.run..5s-===!bg&&q))1-===rz%d file(s) matching %sz Deleting %s) run_commandr.r distributionget_namer1r2joinrsortreverserinfolenrdry_runisdirrrmtreeunlink)rr.patternfilestr4s rrunz rotate.run.sE $$$z % %G'0022S87BGDdmW==>>E==u===E JJLLL MMOOO H-s5zz7 C C C$)++&E % %1***|%w}}Q''%q)))) !  % % %rN)rr) __name__ __module__ __qualname____doc__ description user_optionsr__annotations__rr+rDrrrr r s$$FKL ,.O---- FFFF %%%%%%rr ) __future__rr1typingrrr distutilsrdistutils.errorsr distutils.utilr r rrrrRs"""""" 111111''''''4%4%4%4%4%W4%4%4%4%4%r