Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.69.214.199
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
setuptools /
command /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
217
B
-rw-r--r--
alias.py
2.33
KB
-rw-r--r--
bdist_egg.py
16.21
KB
-rw-r--r--
bdist_rpm.py
1.15
KB
-rw-r--r--
build_clib.py
4.31
KB
-rw-r--r--
build_ext.py
12.9
KB
-rw-r--r--
build_py.py
8.55
KB
-rw-r--r--
develop.py
6.85
KB
-rw-r--r--
dist_info.py
960
B
-rw-r--r--
easy_install.py
85.91
KB
-rw-r--r--
egg_info.py
25.52
KB
-rw-r--r--
install.py
4.79
KB
-rw-r--r--
install_egg_info.py
3.12
KB
-rw-r--r--
install_lib.py
4.92
KB
-rw-r--r--
install_scripts.py
2.53
KB
-rw-r--r--
launcher manifest.xml
628
B
-rw-r--r--
py36compat.py
4.83
KB
-rw-r--r--
register.py
468
B
-rw-r--r--
rotate.py
2.08
KB
-rw-r--r--
saveopts.py
658
B
-rw-r--r--
sdist.py
6.26
KB
-rw-r--r--
setopt.py
4.97
KB
-rw-r--r--
test.py
7.9
KB
-rw-r--r--
upload.py
462
B
-rw-r--r--
upload_docs.py
7.05
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : rotate.py
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os import shutil 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 as e: raise DistutilsOptionError("--keep must be an integer") from e if isinstance(self.match, str): 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)
Close