Type __init()__ functions, clears all mypy issues

This commit is contained in:
Campbell 2025-05-27 13:57:39 -04:00
parent 2ca2ff1f44
commit 6d38df9133
Signed by: NinjaCheetah
GPG Key ID: 39C2500E1778B156
10 changed files with 13 additions and 13 deletions

View File

@ -57,7 +57,7 @@ class U8Archive:
imet_header: IMETHeader
The IMET header of the U8 archive, if one exists. Otherwise, an empty IMETHeader object.
"""
def __init__(self):
def __init__(self) -> None:
self.u8_magic = b''
self.u8_node_list: List[_U8Node] = [] # All the nodes in the header of a U8 file.
self.file_name_list: List[str] = []
@ -369,7 +369,7 @@ class IMETHeader:
md5_hash : bytes
MD5 sum of the entire header, with this field being all zeros during the hashing.
"""
def __init__(self):
def __init__(self) -> None:
self.magic: str = "" # Should always be "IMET"
self.header_size: int = 0 # Always 1536? I assumed this would mean something, but it's just the header length.
self.imet_version: int = 0 # Always 3?

View File

@ -33,7 +33,7 @@ class SettingTxt:
game : str
Another region code, possibly set by the hidden region select channel.
"""
def __init__(self):
def __init__(self) -> None:
self.area: str = ""
self.model: str = ""
self.dvd: int = 0

View File

@ -36,7 +36,7 @@ class UidSys:
The entries stored in the uid.sys file.
"""
def __init__(self):
def __init__(self) -> None:
self.uid_entries: List[_UidSysEntry] = []
def load(self, uid_sys: bytes) -> None:

View File

@ -60,7 +60,7 @@ class Certificate:
pub_key_exponent: int
The exponent of this certificate's public key. Combined with the modulus to get the full key.
"""
def __init__(self):
def __init__(self) -> None:
self.type: CertificateType = CertificateType.RSA_4096
self.signature: bytes = b''
self.issuer: str = ""
@ -151,7 +151,7 @@ class CertificateChain:
ticket_cert: Certificate
The XS (Ticket) certificate from the chain.
"""
def __init__(self):
def __init__(self) -> None:
self.ca_cert: Certificate = Certificate()
self.tmd_cert: Certificate = Certificate()
self.ticket_cert: Certificate = Certificate()

View File

@ -34,7 +34,7 @@ class ContentRegion:
The total number of contents stored in the region.
"""
def __init__(self):
def __init__(self) -> None:
self.content_records: List[_ContentRecord] = []
self.content_region_size: int = 0 # Size of the content region.
self.num_contents: int = 0 # Number of contents in the content region.
@ -525,7 +525,7 @@ class SharedContentMap:
The shared content records stored in content.map.
"""
def __init__(self):
def __init__(self) -> None:
self.shared_records: List[_SharedContentRecord] = []
def load(self, content_map: bytes) -> None:

View File

@ -20,7 +20,7 @@ class IOSPatcher:
dip_module_index : int
The content index that DIP resides in and where DIP patches are applied. -1 if DIP patches are not applied.
"""
def __init__(self):
def __init__(self) -> None:
self.title: Title = Title()
self.es_module_index: int = -1
self.dip_module_index: int = -1

View File

@ -57,7 +57,7 @@ class Ticket:
common_key_index : int
The index of the common key required to decrypt this ticket's Title Key.
"""
def __init__(self):
def __init__(self) -> None:
# If this is a dev ticket
self.is_dev: bool = False # Defaults to false, set to true during load if this ticket is using dev certs.
# Signature blob header

View File

@ -33,7 +33,7 @@ class Title:
content: ContentRegion
A ContentRegion object containing the title's contents.
"""
def __init__(self):
def __init__(self) -> None:
self.wad: _WAD = _WAD()
self.cert_chain: _CertificateChain = _CertificateChain()
self.tmd: _TMD = _TMD()

View File

@ -34,7 +34,7 @@ class TMD:
num_contents : int
The number of contents listed in the TMD.
"""
def __init__(self):
def __init__(self) -> None:
self.blob_header: bytes = b''
self.signature_type: bytes = b''
self.signature: bytes = b''

View File

@ -29,7 +29,7 @@ class WAD:
wad_meta_size : int
The size of the WAD's meta/footer.
"""
def __init__(self):
def __init__(self) -> None:
self.wad_hdr_size: int = 64
self.wad_type: str = "Is"
self.wad_version: bytes = b'\x00\x00'