• File: rotate.cpython-36.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python3.6/site-packages/setuptools/command/__pycache__/rotate.cpython-36.pyc
  • Date Modified: 10/18/2026 11:59 PM
  • File size: 2.44 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
3

l]jt@s`ddlmZddlmZddlmZddlZddlZddlm	Z	ddl
mZGdddeZdS)	)convert_path)log)DistutilsOptionErrorN)six)Commandc@s:eZdZdZdZdddgZgZdd
ZddZddZ	dS)rotatezDelete older distributionsz2delete older distributions, keeping N newest filesmatch=mpatterns to match (required)	dist-dir=d%directory where the distributions arekeep=k(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/usr/lib/python3.6/rotate.pyinitialize_optionsszrotate.initialize_optionscCs|jdkrtd|jdkr$tdyt|j|_Wntk
rPtdYnXt|jtjrxdd|jjdD|_|j	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|jqSr)rstrip).0prrr
<listcomp>+sz+rotate.finalize_options.<locals>.<listcomp>,Zbdistr)rr)
rrrint
ValueError
isinstancerZstring_typessplitZset_undefined_options)rrrrfinalize_optionss

zrotate.finalize_optionscCs|jdddlm}x|jD]}|jjd|}|tjj|j|}dd|D}|j	|j
tjdt
||||jd}xD|D]<\}}tjd||jstjj|rtj|qtj|qWqWdS)	NZegg_infor)glob*cSsg|]}tjj||fqSr)ospathgetmtime)rfrrrr6szrotate.run.<locals>.<listcomp>z%d file(s) matching %szDeleting %s)Zrun_commandr"rZdistributionZget_namer$r%joinrsortreverserinfolenrZdry_runisdirshutilZrmtreeunlink)rr"patternfilestr'rrrrun/s 
z
rotate.runN)rr	r
)rrr
)rrr)
__name__
__module____qualname____doc__descriptionZuser_optionsZboolean_optionsrr!r3rrrrrsr)
Zdistutils.utilrZ	distutilsrZdistutils.errorsrr$r.Zsetuptools.externrZ
setuptoolsrrrrrr<module>s