Cleanup: Reformat with black

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2023-11-02 14:40:27 +01:00
parent 74b3df5f99
commit b3fb7845c3
5 changed files with 11 additions and 9 deletions

View File

@ -626,7 +626,6 @@ class BlendFileBlock:
the_bytes = the_bytes[:first_null] the_bytes = the_bytes[:first_null]
return the_bytes.decode() return the_bytes.decode()
def get_recursive_iter( def get_recursive_iter(
self, self,
path: dna.FieldPath, path: dna.FieldPath,

View File

@ -102,7 +102,7 @@ class Packer:
*, *,
noop=False, noop=False,
compress=False, compress=False,
relative_only=False relative_only=False,
) -> None: ) -> None:
self.blendfile = bfile self.blendfile = bfile
self.project = project self.project = project
@ -475,8 +475,9 @@ class Packer:
# It is *not* used for any disk I/O, since the file may not even # It is *not* used for any disk I/O, since the file may not even
# exist on the local filesystem. # exist on the local filesystem.
bfile_pp = action.new_path bfile_pp = action.new_path
assert bfile_pp is not None, \ assert (
f"Action {action.path_action.name} on {bfile_path} has no final path set, unable to process" bfile_pp is not None
), f"Action {action.path_action.name} on {bfile_path} has no final path set, unable to process"
# Use tempfile to create a unique name in our temporary directoy. # Use tempfile to create a unique name in our temporary directoy.
# The file should be deleted when self.close() is called, and not # The file should be deleted when self.close() is called, and not

View File

@ -39,7 +39,7 @@ class BlendPathTest(unittest.TestCase):
PurePath("C:/some/file.blend"), BlendPath(b"C:/some/file.blend").to_path() PurePath("C:/some/file.blend"), BlendPath(b"C:/some/file.blend").to_path()
) )
self.assertEqual( self.assertEqual(
PurePath("C:/some/file.blend"), BlendPath(br"C:\some\file.blend").to_path() PurePath("C:/some/file.blend"), BlendPath(rb"C:\some\file.blend").to_path()
) )
with mock.patch("sys.getfilesystemencoding") as mock_getfse: with mock.patch("sys.getfilesystemencoding") as mock_getfse:

View File

@ -62,6 +62,7 @@ class AssetHoldingBlocksTest(AbstractTracerTest):
self.assertEqual(965, len(self.bf.blocks)) self.assertEqual(965, len(self.bf.blocks))
self.assertEqual(4, blocks_seen) self.assertEqual(4, blocks_seen)
class DepsTest(AbstractTracerTest): class DepsTest(AbstractTracerTest):
@staticmethod @staticmethod
def field_name(field: dna.Field) -> typing.Optional[str]: def field_name(field: dna.Field) -> typing.Optional[str]:
@ -191,11 +192,11 @@ class DepsTest(AbstractTracerTest):
def test_seq_image_udim_sequence(self): def test_seq_image_udim_sequence(self):
expects = { expects = {
b"IMcube_UDIM.color": Expect( b"IMcube_UDIM.color": Expect(
'Image', "Image",
'name[1024]', "name[1024]",
None, None,
None, None,
b'//cube_UDIM.color.<UDIM>.png', b"//cube_UDIM.color.<UDIM>.png",
True, True,
), ),
} }

View File

@ -24,7 +24,8 @@ class ExpandFileSequenceTest(AbstractBlendFileTest):
path = self.blendfiles / "udim/cube_UDIM.color.<UDIM>.png" path = self.blendfiles / "udim/cube_UDIM.color.<UDIM>.png"
actual = list(file_sequence.expand_sequence(path)) actual = list(file_sequence.expand_sequence(path))
imgseq = [ imgseq = [
self.blendfiles / ("udim/cube_UDIM.color.%04d.png" % num) for num in range(1001, 1004) self.blendfiles / ("udim/cube_UDIM.color.%04d.png" % num)
for num in range(1001, 1004)
] ]
self.assertEqual(imgseq, actual) self.assertEqual(imgseq, actual)