$84 GRAYBYTE WORDPRESS FILE MANAGER $49

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python33/lib/python3.3/site-packages/setuptools/command/

HOME
Current File : /opt/alt/python33/lib/python3.3/site-packages/setuptools/command//rotate.py
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)



























Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.37 PM
root / linksafe
0755
__pycache__
--
3 Mar 2024 10.37 PM
root / linksafe
0755
__init__.py
0.54 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
alias.py
2.428 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
bdist_egg.py
18.279 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
bdist_rpm.py
1.978 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
bdist_wininst.py
2.229 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
build_ext.py
11.576 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
build_py.py
8.242 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
develop.py
6.296 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
easy_install.py
71.012 KB
13 Nov 2023 9.19 PM
root / linksafe
0755
egg_info.py
13.984 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
install.py
3.97 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
install_egg_info.py
3.743 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
install_lib.py
2.428 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
install_scripts.py
2.02 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
register.py
0.271 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
rotate.py
2.014 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
saveopts.py
0.688 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
sdist.py
8.146 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
setopt.py
4.949 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
test.py
5.793 KB
13 Nov 2023 9.19 PM
root / linksafe
0644
upload_docs.py
6.647 KB
13 Nov 2023 9.19 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF