From 61b4bb24e06aa955484293d35fa926c07887544b Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 7 Jun 2021 09:59:54 -0400 Subject: Add type hints to basicblock.py, lowlevelil.py, architecture.py --- python/examples/nsf.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'python/examples/nsf.py') diff --git a/python/examples/nsf.py b/python/examples/nsf.py index 959dc060..45500cba 100644 --- a/python/examples/nsf.py +++ b/python/examples/nsf.py @@ -39,10 +39,10 @@ class NSFView(BinaryView): def __init__(self, data): BinaryView.__init__(self, parent_view=data, file_metadata=data.file) - self.platform = Architecture["6502"].standalone_platform + self.platform = Architecture["6502"].standalone_platform # type: ignore - @classmethod - def is_valid_for_data(self, data): + @staticmethod + def is_valid_for_data(data): hdr = data.read(0, 128) if len(hdr) < 128: return False @@ -57,25 +57,25 @@ class NSFView(BinaryView): def init(self): try: hdr = self.parent_view.read(0, 128) - self.version = struct.unpack("B", hdr[5])[0] - self.song_count = struct.unpack("B", hdr[6])[0] - self.starting_song = struct.unpack("B", hdr[7])[0] + self.version = int(hdr[5]) + self.song_count = int(hdr[6]) + self.starting_song = int(hdr[7]) self.load_address = struct.unpack("