diff --git a/VideoSort.py b/VideoSort.py index e108e48..041fe4f 100755 --- a/VideoSort.py +++ b/VideoSort.py @@ -475,10 +475,10 @@ def move_satellites(videofile, dest): if guess and 'subtitle_language' in guess: fbase = fbase[:fbase.rfind('.')] # Use alpha2 subtitle language from GuessIt (en, es, de, etc.) - subpart = '.' + guess['subtitle_language'][0].alpha2 + subpart = '.' + guess['subtitle_language'].alpha2 if verbose: if subpart != '': - print('Satellite: %s is a subtitle [%s]' % (filename, guess['subtitle_language'][0])) + print('Satellite: %s is a subtitle [%s]' % (filename, guess['subtitle_language'])) else: # English (or undetermined) print('Satellite: %s is a subtitle' % filename) @@ -489,7 +489,7 @@ def move_satellites(videofile, dest): if guess is not None: # Guess details are not important, just that there was a match fbase = base - if fbase.lower() == base.lower(): + if fbase.lower() != base.lower(): old = fpath new = destbasenm + subpart + fext if verbose: @@ -619,7 +619,7 @@ def get_titles(name, titleing=False): ''' #make valid filename - title = re.sub('[\"\:\?\*\\\/\<\>\|]', ' ', name) + title = re.sub(r'[\":\?\*\\\/\<\>\|]', ' ', name) if titleing: title = titler(title) # title the show name so it is in a consistant letter case @@ -1022,9 +1022,9 @@ def deobfuscate_path(filename): def remove_year(title): """ Removes year from series name (if exist) """ - m = re.compile('..*(\((19|20)\d\d\))').search(title) + m = re.compile(r'..*(\((19|20)\d\d\))').search(title) if not m: - m = re.compile('..*((19|20)\d\d)').search(title) + m = re.compile(r'..*((19|20)\d\d)').search(title) if m: if verbose: print('Removing year from series name') diff --git a/lib/babelfish/converters/__init__.py b/lib/babelfish/converters/__init__.py index feb687b..5f85fe7 100644 --- a/lib/babelfish/converters/__init__.py +++ b/lib/babelfish/converters/__init__.py @@ -2,13 +2,16 @@ # Use of this source code is governed by the 3-clause BSD license # that can be found in the LICENSE file. # -import collections +try: + from collections.abc import MutableMapping +except ImportError: + from collections import MutableMapping from pkg_resources import iter_entry_points, EntryPoint from ..exceptions import LanguageConvertError, LanguageReverseError # from https://github.com/kennethreitz/requests/blob/master/requests/structures.py -class CaseInsensitiveDict(collections.MutableMapping): +class CaseInsensitiveDict(MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of diff --git a/lib/dateutil/parser.py b/lib/dateutil/parser.py index 8b6c2d2..aa15aed 100644 --- a/lib/dateutil/parser.py +++ b/lib/dateutil/parser.py @@ -9,6 +9,11 @@ import string import time import collections +try: + from collections.abc import Callable +except ImportError: + from collections import Callable + from io import StringIO from six import text_type, binary_type, integer_types @@ -311,9 +316,9 @@ def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, if res.weekday is not None and not res.day: ret = ret+relativedelta.relativedelta(weekday=res.weekday) if not ignoretz: - if (isinstance(tzinfos, collections.Callable) or + if (isinstance(tzinfos, Callable) or tzinfos and res.tzname in tzinfos): - if isinstance(tzinfos, collections.Callable): + if isinstance(tzinfos, Callable): tzdata = tzinfos(res.tzname, res.tzoffset) else: tzdata = tzinfos.get(res.tzname) diff --git a/lib/pkg_resources.py b/lib/pkg_resources.py index 31736f4..fa4dce8 100755 --- a/lib/pkg_resources.py +++ b/lib/pkg_resources.py @@ -13,7 +13,7 @@ method. """ -import sys, os, zipimport, time, re, imp, types +import sys, os, zipimport, time, re, importlib, types #PY3: from urlparse import urlparse, urlunparse #PY3: diff --git a/lib/rebulk/loose.py b/lib/rebulk/loose.py index 72543b1..5977d64 100644 --- a/lib/rebulk/loose.py +++ b/lib/rebulk/loose.py @@ -63,7 +63,7 @@ def function_args(callable_, *args, **kwargs): :return: (args, kwargs) matching the function signature :rtype: tuple """ - argspec = inspect.getargspec(callable_) # pylint:disable=deprecated-method + argspec = inspect.getfullargspec(callable_) return argspec_args(argspec, False, *args, **kwargs) @@ -80,7 +80,7 @@ def constructor_args(class_, *args, **kwargs): :return: (args, kwargs) matching the function signature :rtype: tuple """ - argspec = inspect.getargspec(_constructor(class_)) # pylint:disable=deprecated-method + argspec = inspect.getfullargspec(_constructor(class_)) return argspec_args(argspec, True, *args, **kwargs) @@ -99,7 +99,7 @@ def argspec_args(argspec, constructor, *args, **kwargs): :return: (args, kwargs) matching the function signature :rtype: tuple """ - if argspec.keywords: + if argspec.varkw: call_kwarg = kwargs else: call_kwarg = dict((k, kwargs[k]) for k in kwargs if k in argspec.args) # Python 2.6 dict comprehension diff --git a/lib/rebulk/match.py b/lib/rebulk/match.py index a786df4..aeb75c0 100644 --- a/lib/rebulk/match.py +++ b/lib/rebulk/match.py @@ -5,7 +5,12 @@ """ import copy import itertools -from collections import defaultdict, MutableSequence +import collections +try: + from collections import defaultdict + from collections.abc import MutableSequence +except ImportError: + from collections import defaultdict, MutableSequence try: from collections import OrderedDict # pylint:disable=ungrouped-imports diff --git a/lib/rebulk/utils.py b/lib/rebulk/utils.py index 9aaf56d..f36338f 100644 --- a/lib/rebulk/utils.py +++ b/lib/rebulk/utils.py @@ -3,7 +3,10 @@ """ Various utilities functions """ -from collections import MutableSet +try: + from collections.abc import MutableSet +except ImportError: + from collections import MutablSet from types import GeneratorType diff --git a/yes b/yes new file mode 100644 index 0000000..62c0c2a --- /dev/null +++ b/yes @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACDGd9M18gUDNdnkDqdTD8r7SiGdKKodTbSrjK36j2T52gAAAJCSuoA1krqA +NQAAAAtzc2gtZWQyNTUxOQAAACDGd9M18gUDNdnkDqdTD8r7SiGdKKodTbSrjK36j2T52g +AAAEChs6KJtZJUfOpKfsaZjGcKwo09Dz8bR7bNhFbSu4FRHcZ30zXyBQM12eQOp1MPyvtK +IZ0oqh1NtKuMrfqPZPnaAAAACWh0cGNAaHRwYwECAwQ= +-----END OPENSSH PRIVATE KEY----- diff --git a/yes.pub b/yes.pub new file mode 100644 index 0000000..0a097f7 --- /dev/null +++ b/yes.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMZ30zXyBQM12eQOp1MPyvtKIZ0oqh1NtKuMrfqPZPna htpc@htpc