ó ž­çSc@svddlmZddlmZddlmZddlZddlmZddl m Z defd„ƒYZ dS( i˙˙˙˙(t convert_path(tlog(tDistutilsOptionErrorN(tCommand(t basestringtrotatecBsDeZdZdZdddgZgZd „Zd „Zd „ZRS(sDelete older distributionss2delete older distributions, keeping N newest filessmatch=tmspatterns to match (required)s dist-dir=tds%directory where the distributions areskeep=tks(number of matching distributions to keepcCsd|_d|_d|_dS(N(tNonetmatchtdist_dirtkeep(tself((sC/usr/local/lib/python2.7/site-packages/setuptools/command/rotate.pytinitialize_optionss  cCsĎ|jdkrtdƒ‚n|jdkr<tdƒ‚nyt|jƒ|_Wntk rqtdƒ‚nXt|jtƒrťg|jjdƒD]}t |j ƒƒ^q—|_n|j ddƒdS(NsQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')s$Must specify number of files to keeps--keep must be an integert,tbdistR (sdist_dirsdist_dir( R R RR tintt ValueErrort isinstanceRtsplitRtstriptset_undefined_options(R tp((sC/usr/local/lib/python2.7/site-packages/setuptools/command/rotate.pytfinalize_optionss  7cCs|jdƒddlm}xë|jD]ŕ}|jjƒd|}|tjj|j|ƒƒ}g|D]}tjj |ƒ|f^qi}|j ƒ|j ƒt j dt|ƒ|ƒ||j}x=|D]5\}}t j d|ƒ|jsÎtj|ƒqÎqÎWq'WdS(Ntegg_infoi˙˙˙˙(tglobt*s%d file(s) matching %ss Deleting %s(t run_commandRR t distributiontget_nametostpathtjoinR tgetmtimetsorttreverseRtinfotlenR tdry_runtunlink(R Rtpatterntfilestftt((sC/usr/local/lib/python2.7/site-packages/setuptools/command/rotate.pytrun-s +    (smatch=Rspatterns to match (required)(s dist-dir=Rs%directory where the distributions are(skeep=Rs(number of matching distributions to keep( t__name__t __module__t__doc__t descriptiont user_optionstboolean_optionsRRR-(((sC/usr/local/lib/python2.7/site-packages/setuptools/command/rotate.pyR s   ( tdistutils.utilRt distutilsRtdistutils.errorsRRt setuptoolsRtsetuptools.compatRR(((sC/usr/local/lib/python2.7/site-packages/setuptools/command/rotate.pyts