Added BlendFileBlock.id_name property

Evaluated only once, so safe to call multiple times without producing
excessive disk I/O. Returns None instead of raising KeyError when there is
no (b'id', b'name') field.
This commit is contained in:
Sybren A. Stüvel
2018-03-02 11:26:02 +01:00
parent 2bb9cffa49
commit 7167d51730
4 changed files with 26 additions and 11 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ class AssetHoldingBlocksTest(AbstractTracerTest):
# Do some arbitrary tests that convince us stuff is read well.
if block.code == b'SC':
seen_scene = True
self.assertEqual(b'SCScene', block[b'id', b'name'])
self.assertEqual(b'SCScene', block.id_name)
continue
if block.code == b'OB':