def draw_str(self): """ Returns the string holding the human readable drawing of the partitions in the memory map. """ table = prettytable.PrettyTable(["Name", "Start blk", "Last blk", "Size* (blk)", "Offset", "Size (b)", "Size (b)", "Size (mb)", "Filesystem"]) table.sortby = "Start blk" table.align["Name"] = "l" # Left align names for part in self._partitions: off = part.start_blk * self._nand_blk_size size_b = int(part.size_blks * self._nand_blk_size) size_mb = size_b / float(1024 * 1024) table.add_row([part.name, part.start_blk, part.start_blk + part.size_blks - 1, part.size_blks, hexutils.hex_format(off), hexutils.hex_format(size_b), size_b, "%.02f" % size_mb, 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()
def draw_str(self): """ Returns the string holding the human readable drawing of the partitions in the memory map. """ table = prettytable.PrettyTable([ "Name", "Start blk", "Last blk", "Size* (blk)", "Offset", "Size (b)", "Size (b)", "Size (mb)", "Filesystem" ]) table.sortby = "Start blk" table.align["Name"] = "l" # Left align names for part in self._partitions: off = part.start_blk * self._nand_blk_size size_b = int(part.size_blks * self._nand_blk_size) size_mb = size_b / float(1024 * 1024) table.add_row([ part.name, part.start_blk, part.start_blk + part.size_blks - 1, part.size_blks, hexutils.hex_format(off), hexutils.hex_format(size_b), size_b, "%.02f" % size_mb, 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()