Check if any blank blocks are present and warn the user if so
This commit is contained in:
1 parent
ca83aec1e9
commit
be70dd0f0d
1 file changed
+5
@@ -87,6 +87,11 @@ class Tag():
|
||||
self.filename = filename
|
||||
self.blocks = list(data[0+i:BYTES_PER_BLOCK+i] for i in range(0, len(data), BYTES_PER_BLOCK))
|
||||
|
||||
# Check for blank blocks
|
||||
for bi in IMPORTANT_BLOCKS:
|
||||
if self.blocks[bi] == b'\x00' * BYTES_PER_BLOCK:
|
||||
print(f"Warning! Block {bi} is blank!")
|
||||
|
||||
# Parse the data
|
||||
self.data = {
|
||||
"uid": bytes_to_hex(self.blocks[0][0:4]),
|
||||
|
||||
Reference in new issue
Block a user