From be70dd0f0de3e7bf33e9e51e5ffc47ea41d60f10 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Tue, 28 May 2024 06:41:05 -0700 Subject: [PATCH] Check if any blank blocks are present and warn the user if so --- parse.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parse.py b/parse.py index cd583b0..9ffbc9f 100644 --- a/parse.py +++ b/parse.py @@ -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]),