def draw_str(self): """ Returns the string holding the human readable drawing of the partitions in the memory map. """ table = prettytable.PrettyTable([ "Name", "Start (cyl)", "Size* (cyl)", "Start (b)", "Size (b)", "Size (mb)", "Bootable", "Type", "Filesystem" ]) table.sortby = "Start (cyl)" table.align["Name"] = "l" # Left align names for part in self._partitions: # Start info - bytes start_b = part.start * geometry.CYLINDER_BYTE_SIZE start_b = hexutils.hex_format(start_b) # Size info - bytes and mbytes size_b = geometry.FULL_SIZE size_mb = geometry.FULL_SIZE if part.size != geometry.FULL_SIZE: size_b = int(part.size * geometry.CYLINDER_BYTE_SIZE) size_mb = int(size_b) >> 20 table.add_row([ part.name, part.start, part.size, start_b, size_b, size_mb, '*' if part.is_bootable else '', Partition.decode_partition_type(part.type), part.filesystem ]) return table.get_string()
def draw_str(self): """ Returns the string holding the human readable drawing of the partitions in the memory map. """ table = prettytable.PrettyTable(["Name", "Start (cyl)", "Size* (cyl)", "Start (b)", "Size (b)", "Size (mb)", "Bootable", "Type", "Filesystem"]) table.sortby = "Start (cyl)" table.align["Name"] = "l" # Left align names for part in self._partitions: # Start info - bytes start_b = part.start * geometry.CYLINDER_BYTE_SIZE start_b = hexutils.hex_format(start_b) # Size info - bytes and mbytes size_b = geometry.FULL_SIZE size_mb = geometry.FULL_SIZE if part.size != geometry.FULL_SIZE: size_b = int(part.size * geometry.CYLINDER_BYTE_SIZE) size_mb = int(size_b) >> 20 table.add_row([part.name, part.start, part.size, start_b, size_b, size_mb, '*' if part.is_bootable else '', Partition.decode_partition_type(part.type), part.filesystem]) return table.get_string()