mirror of
https://github.com/NinjaCheetah/libWiiPy.git
synced 2025-06-07 06:01:00 -04:00
Type __init()__ functions, clears all mypy issues
This commit is contained in:
parent
2ca2ff1f44
commit
6d38df9133
@ -57,7 +57,7 @@ class U8Archive:
|
|||||||
imet_header: IMETHeader
|
imet_header: IMETHeader
|
||||||
The IMET header of the U8 archive, if one exists. Otherwise, an empty IMETHeader object.
|
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_magic = b''
|
||||||
self.u8_node_list: List[_U8Node] = [] # All the nodes in the header of a U8 file.
|
self.u8_node_list: List[_U8Node] = [] # All the nodes in the header of a U8 file.
|
||||||
self.file_name_list: List[str] = []
|
self.file_name_list: List[str] = []
|
||||||
@ -369,7 +369,7 @@ class IMETHeader:
|
|||||||
md5_hash : bytes
|
md5_hash : bytes
|
||||||
MD5 sum of the entire header, with this field being all zeros during the hashing.
|
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.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.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?
|
self.imet_version: int = 0 # Always 3?
|
||||||
|
@ -33,7 +33,7 @@ class SettingTxt:
|
|||||||
game : str
|
game : str
|
||||||
Another region code, possibly set by the hidden region select channel.
|
Another region code, possibly set by the hidden region select channel.
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.area: str = ""
|
self.area: str = ""
|
||||||
self.model: str = ""
|
self.model: str = ""
|
||||||
self.dvd: int = 0
|
self.dvd: int = 0
|
||||||
|
@ -36,7 +36,7 @@ class UidSys:
|
|||||||
The entries stored in the uid.sys file.
|
The entries stored in the uid.sys file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.uid_entries: List[_UidSysEntry] = []
|
self.uid_entries: List[_UidSysEntry] = []
|
||||||
|
|
||||||
def load(self, uid_sys: bytes) -> None:
|
def load(self, uid_sys: bytes) -> None:
|
||||||
|
@ -60,7 +60,7 @@ class Certificate:
|
|||||||
pub_key_exponent: int
|
pub_key_exponent: int
|
||||||
The exponent of this certificate's public key. Combined with the modulus to get the full key.
|
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.type: CertificateType = CertificateType.RSA_4096
|
||||||
self.signature: bytes = b''
|
self.signature: bytes = b''
|
||||||
self.issuer: str = ""
|
self.issuer: str = ""
|
||||||
@ -151,7 +151,7 @@ class CertificateChain:
|
|||||||
ticket_cert: Certificate
|
ticket_cert: Certificate
|
||||||
The XS (Ticket) certificate from the chain.
|
The XS (Ticket) certificate from the chain.
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.ca_cert: Certificate = Certificate()
|
self.ca_cert: Certificate = Certificate()
|
||||||
self.tmd_cert: Certificate = Certificate()
|
self.tmd_cert: Certificate = Certificate()
|
||||||
self.ticket_cert: Certificate = Certificate()
|
self.ticket_cert: Certificate = Certificate()
|
||||||
|
@ -34,7 +34,7 @@ class ContentRegion:
|
|||||||
The total number of contents stored in the region.
|
The total number of contents stored in the region.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.content_records: List[_ContentRecord] = []
|
self.content_records: List[_ContentRecord] = []
|
||||||
self.content_region_size: int = 0 # Size of the content region.
|
self.content_region_size: int = 0 # Size of the content region.
|
||||||
self.num_contents: int = 0 # Number of contents in 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.
|
The shared content records stored in content.map.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.shared_records: List[_SharedContentRecord] = []
|
self.shared_records: List[_SharedContentRecord] = []
|
||||||
|
|
||||||
def load(self, content_map: bytes) -> None:
|
def load(self, content_map: bytes) -> None:
|
||||||
|
@ -20,7 +20,7 @@ class IOSPatcher:
|
|||||||
dip_module_index : int
|
dip_module_index : int
|
||||||
The content index that DIP resides in and where DIP patches are applied. -1 if DIP patches are not applied.
|
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.title: Title = Title()
|
||||||
self.es_module_index: int = -1
|
self.es_module_index: int = -1
|
||||||
self.dip_module_index: int = -1
|
self.dip_module_index: int = -1
|
||||||
|
@ -57,7 +57,7 @@ class Ticket:
|
|||||||
common_key_index : int
|
common_key_index : int
|
||||||
The index of the common key required to decrypt this ticket's Title Key.
|
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
|
# 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.
|
self.is_dev: bool = False # Defaults to false, set to true during load if this ticket is using dev certs.
|
||||||
# Signature blob header
|
# Signature blob header
|
||||||
|
@ -33,7 +33,7 @@ class Title:
|
|||||||
content: ContentRegion
|
content: ContentRegion
|
||||||
A ContentRegion object containing the title's contents.
|
A ContentRegion object containing the title's contents.
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.wad: _WAD = _WAD()
|
self.wad: _WAD = _WAD()
|
||||||
self.cert_chain: _CertificateChain = _CertificateChain()
|
self.cert_chain: _CertificateChain = _CertificateChain()
|
||||||
self.tmd: _TMD = _TMD()
|
self.tmd: _TMD = _TMD()
|
||||||
|
@ -34,7 +34,7 @@ class TMD:
|
|||||||
num_contents : int
|
num_contents : int
|
||||||
The number of contents listed in the TMD.
|
The number of contents listed in the TMD.
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.blob_header: bytes = b''
|
self.blob_header: bytes = b''
|
||||||
self.signature_type: bytes = b''
|
self.signature_type: bytes = b''
|
||||||
self.signature: bytes = b''
|
self.signature: bytes = b''
|
||||||
|
@ -29,7 +29,7 @@ class WAD:
|
|||||||
wad_meta_size : int
|
wad_meta_size : int
|
||||||
The size of the WAD's meta/footer.
|
The size of the WAD's meta/footer.
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self.wad_hdr_size: int = 64
|
self.wad_hdr_size: int = 64
|
||||||
self.wad_type: str = "Is"
|
self.wad_type: str = "Is"
|
||||||
self.wad_version: bytes = b'\x00\x00'
|
self.wad_version: bytes = b'\x00\x00'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user