VTOC now respects starting sector label when printing out grid

This commit is contained in:
Rob McMullen 2017-02-26 15:23:05 -08:00
parent 28f2d11be2
commit 1011b2dd12

View File

@ -280,7 +280,7 @@ class VTOC(BaseSectorList):
self.parse_segments(segments) self.parse_segments(segments)
def __str__(self): def __str__(self):
return "%s\n (%d free)" % ("\n".join(["track %02d: %s" % (i, line) for i, line in enumerate(str(self.sector_map[0:self.header.tracks_per_disk*self.header.sectors_per_track].reshape([self.header.tracks_per_disk,self.header.sectors_per_track])).splitlines())]), self.num_free_sectors) return "%s\n (%d free)" % ("\n".join(["track %02d: %s" % (i, line) for i, line in enumerate(str(self.sector_map[self.header.starting_sector_label:(self.header.tracks_per_disk*self.header.sectors_per_track) + self.header.starting_sector_label].reshape([self.header.tracks_per_disk,self.header.sectors_per_track])).splitlines())]), self.num_free_sectors)
@property @property
def num_free_sectors(self): def num_free_sectors(self):