Skip to content

Commit

Permalink
wip: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
swysocki committed Jan 17, 2022
1 parent 3952f81 commit f2ac4a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gpt_image/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def __init__(self, geometry: Geometry, is_backup: bool = False):
self.partition_array_length,
self.partition_entry_size,
self.partition_array_crc,
# self.reserved_padding,
]

def as_bytes(self) -> bytes:
Expand Down Expand Up @@ -178,6 +177,12 @@ def __init__(
partition_guid: uuid.UUID = None,
alignment: int = 8,
):
"""Initialize Partition Object
All parameters have a default value to allow Partition() to create
an empty partition object. If "name" is set, we assume this is not
an empty object and set the other values.
"""
# create an empty partition object
self.type_guid = TableEntry(0, 16, b"\x00" * 16)
self.partition_guid = TableEntry(16, 16, b"\x00" * 16)
Expand Down Expand Up @@ -230,8 +235,6 @@ def __init__(self, disk: Disk, sector_size: int = 512) -> None:
self.primary_header = Header(self.geometry)
self.secondary_header = Header(self.geometry, is_backup=True)

# @NOTE: currently using a blank partition entry table
# until partitions are sorted out
self.partition_entries = [Partition()] * 128

def write(self):
Expand Down Expand Up @@ -318,5 +321,4 @@ def checksum_header(self, header: Header):
"""
# zero the old checksum before calculating
header.header_crc.data = b"\x00" * 4

header.header_crc.data = binascii.crc32(header.as_bytes()).to_bytes(4, "little")

0 comments on commit f2ac4a3

Please sign in to comment.