SILENT KILLERPanel

Current Path: > > usr > lib > python3.8 > 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 ]

Files and Folders in: //usr/lib/python3.8/site-packages//setuptools/command

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 594 bytes April 21 2022 12:45:22.
alias.py File 2426 bytes April 21 2022 12:45:22.
bdist_egg.py File 18185 bytes April 21 2022 12:45:22.
bdist_rpm.py File 1508 bytes April 21 2022 12:45:22.
bdist_wininst.py File 637 bytes April 21 2022 12:45:22.
build_clib.py File 4484 bytes April 21 2022 12:45:22.
build_ext.py File 13019 bytes April 21 2022 12:45:22.
build_py.py File 9596 bytes April 21 2022 12:45:22.
develop.py File 8184 bytes April 21 2022 12:45:22.
dist_info.py File 960 bytes April 21 2022 12:45:22.
easy_install.py File 87453 bytes April 21 2022 12:45:22.
egg_info.py File 25570 bytes April 21 2022 12:45:22.
install.py File 4683 bytes April 21 2022 12:45:22.
install_egg_info.py File 2203 bytes April 21 2022 12:45:22.
install_lib.py File 3862 bytes April 21 2022 12:45:22.
install_scripts.py File 2439 bytes April 21 2022 12:45:22.
launcher manifest.xml File 628 bytes April 21 2022 12:45:22.
py36compat.py File 4986 bytes April 21 2022 12:45:22.
register.py File 534 bytes April 21 2022 12:45:22.
rotate.py File 2164 bytes April 21 2022 12:45:22.
saveopts.py File 658 bytes April 21 2022 12:45:22.
sdist.py File 7388 bytes April 21 2022 12:45:22.
setopt.py File 5085 bytes April 21 2022 12:45:22.
test.py File 9602 bytes April 21 2022 12:45:22.
upload.py File 6811 bytes April 21 2022 12:45:22.
upload_docs.py File 7311 bytes April 21 2022 12:45:22.

Reading File: //usr/lib/python3.8/site-packages//setuptools/command/rotate.py

from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import shutil

from setuptools.extern import six

from setuptools import Command


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, six.string_types):
            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:
                    if os.path.isdir(f):
                        shutil.rmtree(f)
                    else:
                        os.unlink(f)

SILENT KILLER Tool