Add Python 3.12 and fix Radarr handling (#1989)

* Added Python3.12 and future 3.13

* Fix Radarr result handling

* remove py2.7 and py3.7 support
This commit is contained in:
Clinton Hall 2024-02-28 15:47:04 +13:00 committed by GitHub
commit f98d6fff65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
173 changed files with 17498 additions and 21001 deletions

View file

@ -4,8 +4,6 @@ from distutils.errors import DistutilsOptionError
import os
import shutil
from setuptools.extern import six
from setuptools import Command
@ -36,12 +34,10 @@ class rotate(Command):
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(',')
]
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):
@ -56,8 +52,8 @@ class rotate(Command):
files.reverse()
log.info("%d file(s) matching %s", len(files), pattern)
files = files[self.keep:]
for (t, f) in files:
files = files[self.keep :]
for t, f in files:
log.info("Deleting %s", f)
if not self.dry_run:
if os.path.isdir(f):