Skip to content

Commit 266d2c7

Browse files
committed
Reformat with black 23.1.0
Signed-off-by: Arthur Zamarin <[email protected]>
1 parent 9f1bd12 commit 266d2c7

30 files changed

+2
-70
lines changed

src/snakeoil/chksum/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class MissingChksumHandler(Exception):
1818

1919

2020
def get_handler(requested):
21-
2221
"""
2322
get a chksum handler
2423
@@ -34,7 +33,6 @@ def get_handler(requested):
3433

3534

3635
def get_handlers(requested=None):
37-
3836
"""
3937
get multiple chksum handlers
4038
@@ -55,7 +53,6 @@ def get_handlers(requested=None):
5553

5654

5755
def init(additional_handlers=None):
58-
5956
"""
6057
init the chksum subsystem.
6158

src/snakeoil/cli/arghparse.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ def _parse_optionals(self, arg_strings, namespace):
726726
arg_string_pattern_parts = []
727727
arg_strings_iter = iter(arg_strings)
728728
for i, arg_string in enumerate(arg_strings_iter):
729-
730729
# all args after -- are non-options
731730
if arg_string == "--":
732731
arg_string_pattern_parts.append("-")
@@ -773,7 +772,6 @@ def take_action(action, argument_strings, option_string=None):
773772

774773
# function to convert arg_strings into an optional action
775774
def consume_optional(start_index):
776-
777775
# get the optional identified at this index
778776
option_tuple = option_string_indices[start_index]
779777
action, option_string, explicit_arg = option_tuple
@@ -783,7 +781,6 @@ def consume_optional(start_index):
783781
match_argument = self._match_argument
784782
action_tuples = []
785783
while True:
786-
787784
# if we found no optional action, skip it
788785
if action is None:
789786
extras.append(arg_strings[start_index])
@@ -882,7 +879,6 @@ def consume_positionals(start_index):
882879
else:
883880
max_option_string_index = -1
884881
while start_index <= max_option_string_index:
885-
886882
# consume any Positionals preceding the next option
887883
next_option_string_index = min(
888884
[index for index in option_string_indices if index >= start_index]

src/snakeoil/compatibility.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
def sorted_key_from_cmp(cmp_func, key_func=None):
99
class _key_proxy:
10-
1110
__slots__ = ("_obj",)
1211

1312
if key_func: # done this way for speed reasons.

src/snakeoil/compression/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def unpack(self, dest=None, **kwargs):
148148

149149

150150
class _Tar(_Archive, ArComp):
151-
152151
exts = frozenset([".tar"])
153152
binary = (
154153
"gtar",
@@ -179,87 +178,74 @@ def _unpack_cmd(self):
179178

180179

181180
class _TarGZ(_Tar):
182-
183181
exts = frozenset([".tar.gz", ".tgz", ".tar.Z", ".tar.z"])
184182
compress_binary = (("pigz",), ("gzip",))
185183

186184

187185
class _TarBZ2(_Tar):
188-
189186
exts = frozenset([".tar.bz2", ".tbz2", ".tbz"])
190187
compress_binary = (("lbzip2",), ("pbzip2",), ("bzip2",))
191188

192189

193190
class _TarLZMA(_Tar):
194-
195191
exts = frozenset([".tar.lzma"])
196192
compress_binary = ("lzma",)
197193

198194

199195
class _TarXZ(_Tar):
200-
201196
exts = frozenset([".tar.xz", ".txz"])
202197
compress_binary = (("pixz",), ("xz", f"-T{multiprocessing.cpu_count()}"))
203198

204199

205200
class _Zip(_Archive, ArComp):
206-
207201
exts = frozenset([".ZIP", ".zip", ".jar"])
208202
binary = ("unzip",)
209203
default_unpack_cmd = '{binary} -qo "{path}"'
210204

211205

212206
class _GZ(_CompressedStdin, ArComp):
213-
214207
exts = frozenset([".gz", ".Z", ".z"])
215208
binary = ("pigz", "gzip")
216209
default_unpack_cmd = "{binary} -d -c"
217210

218211

219212
class _BZ2(_CompressedStdin, ArComp):
220-
221213
exts = frozenset([".bz2", ".bz"])
222214
binary = ("lbzip2", "pbzip2", "bzip2")
223215
default_unpack_cmd = "{binary} -d -c"
224216

225217

226218
class _XZ(_CompressedStdin, ArComp):
227-
228219
exts = frozenset([".xz"])
229220
binary = ("pixz", "xz")
230221
default_unpack_cmd = "{binary} -d -c"
231222

232223

233224
class _7Z(_Archive, ArComp):
234-
235225
exts = frozenset([".7Z", ".7z"])
236226
binary = ("7z",)
237227
default_unpack_cmd = '{binary} x -y "{path}"'
238228

239229

240230
class _Rar(_Archive, ArComp):
241-
242231
exts = frozenset([".RAR", ".rar"])
243232
binary = ("unrar",)
244233
default_unpack_cmd = '{binary} x -idq -o+ "{path}"'
245234

246235

247236
class _LHA(_Archive, ArComp):
248-
249237
exts = frozenset([".LHa", ".LHA", ".lha", ".lzh"])
250238
binary = ("lha",)
251239
default_unpack_cmd = '{binary} xfq "{path}"'
252240

253241

254242
class _Ar(_Archive, ArComp):
255-
256243
exts = frozenset([".a", ".deb"])
257244
binary = ("ar",)
258245
default_unpack_cmd = '{binary} x "{path}"'
259246

260247

261248
class _LZMA(_CompressedFile, ArComp):
262-
263249
exts = frozenset([".lzma"])
264250
binary = ("lzma",)
265251
default_unpack_cmd = '{binary} -dc "{path}"'

src/snakeoil/compression/_bzip2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
native = True
3030
except ImportError:
31-
3231
# We need this because if we are not native then TarFile.bz2open will fail
3332
# (and some code needs to be able to check that).
3433
native = False

src/snakeoil/compression/_xz.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
native = True
3434
except ImportError:
35-
3635
# We need this because if we are not native then TarFile.open will fail
3736
# (and some code needs to be able to check that).
3837
native = False

src/snakeoil/fileutils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def touch(fname: str, mode: int = 0o644, dir_fd=None, **kwargs):
2626
os.utime(
2727
f.fileno() if os.utime in os.supports_fd else fname,
2828
dir_fd=None if os.supports_fd else dir_fd,
29-
**kwargs
29+
**kwargs,
3030
)
3131

3232

@@ -135,7 +135,6 @@ def __del__(self):
135135

136136

137137
class AtomicWriteFile(AtomicWriteFile_mixin):
138-
139138
__doc__ = AtomicWriteFile_mixin.__doc__
140139

141140
def _actual_init(self):

src/snakeoil/formatters.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ def __setattr__(self, key, value):
407407
raise AttributeError(f"{self.__class__.__name__} instances are immutable")
408408

409409
class TerminfoMode(TerminfoCode):
410-
411410
__doc__ = TerminfoCode.__doc__
412411
__slots__ = ()
413412

@@ -416,7 +415,6 @@ def __call__(self, formatter: "TerminfoFormatter"):
416415
formatter.stream.write(self.value)
417416

418417
class TerminfoReset(TerminfoCode):
419-
420418
__doc__ = TerminfoCode.__doc__
421419
__slots__ = ()
422420

src/snakeoil/process/spawn.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def spawn(
176176
cwd: Optional[str] = None,
177177
pgid: Optional[int] = None,
178178
):
179-
180179
"""wrapper around execve
181180
182181
:type mycommand: list or string
@@ -237,7 +236,6 @@ def spawn(
237236
try:
238237
# Otherwise we clean them up.
239238
while mypids:
240-
241239
# Pull the last reader in the pipe chain. If all processes
242240
# in the pipe are well behaved, it will die when the process
243241
# it is reading from dies.
@@ -380,7 +378,6 @@ def spawn_get_output(
380378
split_lines: bool = True,
381379
**kwds,
382380
):
383-
384381
"""Call spawn, collecting the output to fd's specified in collect_fds list.
385382
386383
:param spawn_type: the passed in function to call- typically :func:`spawn_bash`

src/snakeoil/tar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def del_uname(self):
110110

111111
# add in a tweaked ExFileObject that is usable by snakeoil.data_source
112112
class ExFileObject(tarfile.ExFileObject):
113-
114113
exceptions = (EnvironmentError,)
115114

116115

0 commit comments

Comments
 (0)