Current Path: > > opt > alt > > python33 > lib > python3.3 > site-packages > > setuptools > command
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
__init__.py | File | 553 bytes | November 13 2023 21:19:28. | |
alias.py | File | 2486 bytes | November 13 2023 21:19:28. | |
bdist_egg.py | File | 18718 bytes | November 13 2023 21:19:28. | |
bdist_rpm.py | File | 2025 bytes | November 13 2023 21:19:28. | |
bdist_wininst.py | File | 2283 bytes | November 13 2023 21:19:28. | |
build_ext.py | File | 11854 bytes | November 13 2023 21:19:28. | |
build_py.py | File | 8440 bytes | November 13 2023 21:19:28. | |
develop.py | File | 6447 bytes | November 13 2023 21:19:28. | |
easy_install.py | File | 72716 bytes | November 13 2023 21:19:28. | |
egg_info.py | File | 14320 bytes | November 13 2023 21:19:28. | |
install.py | File | 4065 bytes | November 13 2023 21:19:28. | |
install_egg_info.py | File | 3833 bytes | November 13 2023 21:19:28. | |
install_lib.py | File | 2486 bytes | November 13 2023 21:19:28. | |
install_scripts.py | File | 2068 bytes | November 13 2023 21:19:28. | |
register.py | File | 277 bytes | November 13 2023 21:19:28. | |
rotate.py | File | 2062 bytes | November 13 2023 21:19:28. | |
saveopts.py | File | 705 bytes | November 13 2023 21:19:28. | |
sdist.py | File | 8341 bytes | November 13 2023 21:19:28. | |
setopt.py | File | 5068 bytes | November 13 2023 21:19:28. | |
test.py | File | 5932 bytes | November 13 2023 21:19:28. | |
upload_docs.py | File | 6807 bytes | November 13 2023 21:19:28. |
import distutils, os from setuptools import Command from setuptools.compat import basestring from distutils.util import convert_path from distutils import log from distutils.errors import * class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N newest files" user_options = [ ('match=', 'm', "patterns to match (required)"), ('dist-dir=', 'd', "directory where the distributions are"), ('keep=', 'k', "number of matching distributions to keep"), ] boolean_options = [] def initialize_options(self): self.match = None self.dist_dir = None self.keep = None def finalize_options(self): if self.match is None: raise DistutilsOptionError( "Must specify one or more (comma-separated) match patterns " "(e.g. '.zip' or '.egg')" ) if self.keep is None: raise DistutilsOptionError("Must specify number of files to keep") try: self.keep = int(self.keep) except ValueError: raise DistutilsOptionError("--keep must be an integer") if isinstance(self.match, basestring): self.match = [ convert_path(p.strip()) for p in self.match.split(',') ] self.set_undefined_options('bdist',('dist_dir', 'dist_dir')) def run(self): self.run_command("egg_info") from glob import glob for pattern in self.match: pattern = self.distribution.get_name()+'*'+pattern files = glob(os.path.join(self.dist_dir,pattern)) files = [(os.path.getmtime(f),f) for f in files] files.sort() files.reverse() log.info("%d file(s) matching %s", len(files), pattern) files = files[self.keep:] for (t,f) in files: log.info("Deleting %s", f) if not self.dry_run: os.unlink(f)
SILENT KILLER Tool