Cleanup: reformat with Black

This commit is contained in:
Sybren A. Stüvel 2022-03-25 12:06:12 +01:00
parent 3daeb9f80a
commit 63c4745e9f
4 changed files with 8 additions and 6 deletions

View File

@ -45,7 +45,9 @@ class EndianIO:
raise struct.error("%s (read %d bytes)" % (ex, len(data))) from None raise struct.error("%s (read %d bytes)" % (ex, len(data))) from None
@classmethod @classmethod
def _write(cls, fileobj: typing.IO[bytes], typestruct: struct.Struct, value: typing.Any): def _write(
cls, fileobj: typing.IO[bytes], typestruct: struct.Struct, value: typing.Any
):
try: try:
data = typestruct.pack(value) data = typestruct.pack(value)
except struct.error as ex: except struct.error as ex:
@ -210,7 +212,7 @@ class EndianIO:
b"uint": cls.write_uint, b"uint": cls.write_uint,
b"int": cls.write_int, b"int": cls.write_int,
b"ulong": cls.write_ulong, b"ulong": cls.write_ulong,
b"float": cls.write_float b"float": cls.write_float,
} }

View File

@ -554,7 +554,7 @@ class Packer:
def _copy_asset_and_deps(self, asset_path: pathlib.Path, action: AssetAction): def _copy_asset_and_deps(self, asset_path: pathlib.Path, action: AssetAction):
# Copy the asset itself, but only if it's not a sequence (sequences are # Copy the asset itself, but only if it's not a sequence (sequences are
# handled below in the for-loop). # handled below in the for-loop).
if "*" not in str(asset_path) and '<UDIM>' not in asset_path.name: if "*" not in str(asset_path) and "<UDIM>" not in asset_path.name:
packed_path = action.new_path packed_path = action.new_path
assert packed_path is not None assert packed_path is not None
read_path = action.read_from or asset_path read_path = action.read_from or asset_path

View File

@ -43,7 +43,7 @@ def expand_sequence(path: pathlib.Path) -> typing.Iterator[pathlib.Path]:
# Change <UDIM> marker to a glob pattern, then let the glob case handle it. # Change <UDIM> marker to a glob pattern, then let the glob case handle it.
# This assumes that all files that match the glob are actually UDIM # This assumes that all files that match the glob are actually UDIM
# tiles; this could cause some false-positives. # tiles; this could cause some false-positives.
path = path.with_name(path.name.replace('<UDIM>', '*')) path = path.with_name(path.name.replace("<UDIM>", "*"))
if "*" in str(path): # assume it is a glob if "*" in str(path): # assume it is a glob
import glob import glob