diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-03-24 13:53:55 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-03-24 13:53:55 +0300 |
commit | 266d2c7b8b975ccc6361eb47bcab7e73b578a1f6 (patch) | |
tree | f2e765d51bcaa34a5d1d4e7ce93f1e0805a324d1 /src | |
parent | start work on 0.10.6 (diff) | |
download | snakeoil-266d2c7b8b975ccc6361eb47bcab7e73b578a1f6.tar.gz snakeoil-266d2c7b8b975ccc6361eb47bcab7e73b578a1f6.tar.bz2 snakeoil-266d2c7b8b975ccc6361eb47bcab7e73b578a1f6.zip |
Reformat with black 23.1.0
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/snakeoil/chksum/__init__.py | 3 | ||||
-rw-r--r-- | src/snakeoil/cli/arghparse.py | 4 | ||||
-rw-r--r-- | src/snakeoil/compatibility.py | 1 | ||||
-rw-r--r-- | src/snakeoil/compression/__init__.py | 14 | ||||
-rw-r--r-- | src/snakeoil/compression/_bzip2.py | 1 | ||||
-rw-r--r-- | src/snakeoil/compression/_xz.py | 1 | ||||
-rw-r--r-- | src/snakeoil/fileutils.py | 3 | ||||
-rw-r--r-- | src/snakeoil/formatters.py | 2 | ||||
-rw-r--r-- | src/snakeoil/process/spawn.py | 3 | ||||
-rw-r--r-- | src/snakeoil/tar.py | 1 | ||||
-rw-r--r-- | src/snakeoil/test/eq_hash_inheritance.py | 1 | ||||
-rw-r--r-- | src/snakeoil/test/mixins.py | 2 | ||||
-rw-r--r-- | src/snakeoil/test/modules.py | 1 | ||||
-rw-r--r-- | src/snakeoil/test/slot_shadowing.py | 1 |
14 files changed, 1 insertions, 37 deletions
diff --git a/src/snakeoil/chksum/__init__.py b/src/snakeoil/chksum/__init__.py index 5bd6a7c..bc6bef2 100644 --- a/src/snakeoil/chksum/__init__.py +++ b/src/snakeoil/chksum/__init__.py @@ -18,7 +18,6 @@ class MissingChksumHandler(Exception): def get_handler(requested): - """ get a chksum handler @@ -34,7 +33,6 @@ def get_handler(requested): def get_handlers(requested=None): - """ get multiple chksum handlers @@ -55,7 +53,6 @@ def get_handlers(requested=None): def init(additional_handlers=None): - """ init the chksum subsystem. diff --git a/src/snakeoil/cli/arghparse.py b/src/snakeoil/cli/arghparse.py index a1d1c0b..ab458c8 100644 --- a/src/snakeoil/cli/arghparse.py +++ b/src/snakeoil/cli/arghparse.py @@ -726,7 +726,6 @@ class OptionalsParser(argparse.ArgumentParser): arg_string_pattern_parts = [] arg_strings_iter = iter(arg_strings) for i, arg_string in enumerate(arg_strings_iter): - # all args after -- are non-options if arg_string == "--": arg_string_pattern_parts.append("-") @@ -773,7 +772,6 @@ class OptionalsParser(argparse.ArgumentParser): # function to convert arg_strings into an optional action def consume_optional(start_index): - # get the optional identified at this index option_tuple = option_string_indices[start_index] action, option_string, explicit_arg = option_tuple @@ -783,7 +781,6 @@ class OptionalsParser(argparse.ArgumentParser): match_argument = self._match_argument action_tuples = [] while True: - # if we found no optional action, skip it if action is None: extras.append(arg_strings[start_index]) @@ -882,7 +879,6 @@ class OptionalsParser(argparse.ArgumentParser): else: max_option_string_index = -1 while start_index <= max_option_string_index: - # consume any Positionals preceding the next option next_option_string_index = min( [index for index in option_string_indices if index >= start_index] diff --git a/src/snakeoil/compatibility.py b/src/snakeoil/compatibility.py index 4fee417..a602efe 100644 --- a/src/snakeoil/compatibility.py +++ b/src/snakeoil/compatibility.py @@ -7,7 +7,6 @@ __all__ = ("cmp", "sorted_cmp", "sort_cmp") def sorted_key_from_cmp(cmp_func, key_func=None): class _key_proxy: - __slots__ = ("_obj",) if key_func: # done this way for speed reasons. diff --git a/src/snakeoil/compression/__init__.py b/src/snakeoil/compression/__init__.py index 9eee103..96dd75f 100644 --- a/src/snakeoil/compression/__init__.py +++ b/src/snakeoil/compression/__init__.py @@ -148,7 +148,6 @@ class _CompressedStdin: class _Tar(_Archive, ArComp): - exts = frozenset([".tar"]) binary = ( "gtar", @@ -179,87 +178,74 @@ class _Tar(_Archive, ArComp): class _TarGZ(_Tar): - exts = frozenset([".tar.gz", ".tgz", ".tar.Z", ".tar.z"]) compress_binary = (("pigz",), ("gzip",)) class _TarBZ2(_Tar): - exts = frozenset([".tar.bz2", ".tbz2", ".tbz"]) compress_binary = (("lbzip2",), ("pbzip2",), ("bzip2",)) class _TarLZMA(_Tar): - exts = frozenset([".tar.lzma"]) compress_binary = ("lzma",) class _TarXZ(_Tar): - exts = frozenset([".tar.xz", ".txz"]) compress_binary = (("pixz",), ("xz", f"-T{multiprocessing.cpu_count()}")) class _Zip(_Archive, ArComp): - exts = frozenset([".ZIP", ".zip", ".jar"]) binary = ("unzip",) default_unpack_cmd = '{binary} -qo "{path}"' class _GZ(_CompressedStdin, ArComp): - exts = frozenset([".gz", ".Z", ".z"]) binary = ("pigz", "gzip") default_unpack_cmd = "{binary} -d -c" class _BZ2(_CompressedStdin, ArComp): - exts = frozenset([".bz2", ".bz"]) binary = ("lbzip2", "pbzip2", "bzip2") default_unpack_cmd = "{binary} -d -c" class _XZ(_CompressedStdin, ArComp): - exts = frozenset([".xz"]) binary = ("pixz", "xz") default_unpack_cmd = "{binary} -d -c" class _7Z(_Archive, ArComp): - exts = frozenset([".7Z", ".7z"]) binary = ("7z",) default_unpack_cmd = '{binary} x -y "{path}"' class _Rar(_Archive, ArComp): - exts = frozenset([".RAR", ".rar"]) binary = ("unrar",) default_unpack_cmd = '{binary} x -idq -o+ "{path}"' class _LHA(_Archive, ArComp): - exts = frozenset([".LHa", ".LHA", ".lha", ".lzh"]) binary = ("lha",) default_unpack_cmd = '{binary} xfq "{path}"' class _Ar(_Archive, ArComp): - exts = frozenset([".a", ".deb"]) binary = ("ar",) default_unpack_cmd = '{binary} x "{path}"' class _LZMA(_CompressedFile, ArComp): - exts = frozenset([".lzma"]) binary = ("lzma",) default_unpack_cmd = '{binary} -dc "{path}"' diff --git a/src/snakeoil/compression/_bzip2.py b/src/snakeoil/compression/_bzip2.py index 122debd..77c121b 100644 --- a/src/snakeoil/compression/_bzip2.py +++ b/src/snakeoil/compression/_bzip2.py @@ -28,7 +28,6 @@ try: native = True except ImportError: - # We need this because if we are not native then TarFile.bz2open will fail # (and some code needs to be able to check that). native = False diff --git a/src/snakeoil/compression/_xz.py b/src/snakeoil/compression/_xz.py index 9a91a4c..0f13046 100644 --- a/src/snakeoil/compression/_xz.py +++ b/src/snakeoil/compression/_xz.py @@ -32,7 +32,6 @@ try: native = True except ImportError: - # We need this because if we are not native then TarFile.open will fail # (and some code needs to be able to check that). native = False diff --git a/src/snakeoil/fileutils.py b/src/snakeoil/fileutils.py index 743ef2d..02355a8 100644 --- a/src/snakeoil/fileutils.py +++ b/src/snakeoil/fileutils.py @@ -26,7 +26,7 @@ def touch(fname: str, mode: int = 0o644, dir_fd=None, **kwargs): os.utime( f.fileno() if os.utime in os.supports_fd else fname, dir_fd=None if os.supports_fd else dir_fd, - **kwargs + **kwargs, ) @@ -135,7 +135,6 @@ class AtomicWriteFile_mixin: class AtomicWriteFile(AtomicWriteFile_mixin): - __doc__ = AtomicWriteFile_mixin.__doc__ def _actual_init(self): diff --git a/src/snakeoil/formatters.py b/src/snakeoil/formatters.py index 151778c..0f65209 100644 --- a/src/snakeoil/formatters.py +++ b/src/snakeoil/formatters.py @@ -407,7 +407,6 @@ else: raise AttributeError(f"{self.__class__.__name__} instances are immutable") class TerminfoMode(TerminfoCode): - __doc__ = TerminfoCode.__doc__ __slots__ = () @@ -416,7 +415,6 @@ else: formatter.stream.write(self.value) class TerminfoReset(TerminfoCode): - __doc__ = TerminfoCode.__doc__ __slots__ = () diff --git a/src/snakeoil/process/spawn.py b/src/snakeoil/process/spawn.py index 2709598..9908c8d 100644 --- a/src/snakeoil/process/spawn.py +++ b/src/snakeoil/process/spawn.py @@ -176,7 +176,6 @@ def spawn( cwd: Optional[str] = None, pgid: Optional[int] = None, ): - """wrapper around execve :type mycommand: list or string @@ -237,7 +236,6 @@ def spawn( try: # Otherwise we clean them up. while mypids: - # Pull the last reader in the pipe chain. If all processes # in the pipe are well behaved, it will die when the process # it is reading from dies. @@ -380,7 +378,6 @@ def spawn_get_output( split_lines: bool = True, **kwds, ): - """Call spawn, collecting the output to fd's specified in collect_fds list. :param spawn_type: the passed in function to call- typically :func:`spawn_bash` diff --git a/src/snakeoil/tar.py b/src/snakeoil/tar.py index 74061a5..6f74ef2 100644 --- a/src/snakeoil/tar.py +++ b/src/snakeoil/tar.py @@ -110,7 +110,6 @@ class TarInfo(tarfile.TarInfo): # add in a tweaked ExFileObject that is usable by snakeoil.data_source class ExFileObject(tarfile.ExFileObject): - exceptions = (EnvironmentError,) diff --git a/src/snakeoil/test/eq_hash_inheritance.py b/src/snakeoil/test/eq_hash_inheritance.py index eaa42a3..98c6468 100644 --- a/src/snakeoil/test/eq_hash_inheritance.py +++ b/src/snakeoil/test/eq_hash_inheritance.py @@ -2,7 +2,6 @@ from . import mixins class Test(mixins.TargetedNamespaceWalker, mixins.KlassWalker): - target_namespace = "snakeoil" singleton = object() diff --git a/src/snakeoil/test/mixins.py b/src/snakeoil/test/mixins.py index 0648de1..eb8dae1 100644 --- a/src/snakeoil/test/mixins.py +++ b/src/snakeoil/test/mixins.py @@ -8,7 +8,6 @@ from ..compatibility import IGNORED_EXCEPTIONS class PythonNamespaceWalker: - ignore_all_import_failures = False valid_inits = frozenset(f"__init__.{x}" for x in ("py", "pyc", "pyo", "so")) @@ -144,7 +143,6 @@ class TargetedNamespaceWalker(PythonNamespaceWalker): class _classWalker: - cls_blacklist = frozenset() def is_blacklisted(self, cls): diff --git a/src/snakeoil/test/modules.py b/src/snakeoil/test/modules.py index 0ae116b..3758960 100644 --- a/src/snakeoil/test/modules.py +++ b/src/snakeoil/test/modules.py @@ -2,7 +2,6 @@ from . import mixins class ExportedModules(mixins.PythonNamespaceWalker): - target_namespace = "snakeoil" def test__all__accuracy(self): diff --git a/src/snakeoil/test/slot_shadowing.py b/src/snakeoil/test/slot_shadowing.py index fac6619..abb8e09 100644 --- a/src/snakeoil/test/slot_shadowing.py +++ b/src/snakeoil/test/slot_shadowing.py @@ -4,7 +4,6 @@ from . import mixins class SlotShadowing(mixins.TargetedNamespaceWalker, mixins.SubclassWalker): - target_namespace = "snakeoil" err_if_slots_is_str = True err_if_slots_is_mutable = True |