Fix sectors/bytes type problem with single partition

This commit is contained in:
Anders Ingemann 2015-01-03 12:44:57 +01:00
parent f43e2480a5
commit 16eaade09a
4 changed files with 6 additions and 6 deletions

View file

@ -38,7 +38,7 @@ class AbstractPartitionMap(FSMProxy):
"""Returns the total size the partitions occupy """Returns the total size the partitions occupy
:return: The size of all partitions :return: The size of all partitions
:rtype: Bytes :rtype: Sectors
""" """
# We just need the endpoint of the last partition # We just need the endpoint of the last partition
return self.partitions[-1].get_end() return self.partitions[-1].get_end()

View file

@ -53,7 +53,7 @@ class AbstractPartition(FSMProxy):
"""Gets the end of the partition """Gets the end of the partition
:return: The end of the partition :return: The end of the partition
:rtype: Bytes :rtype: Sectors
""" """
return self.get_start() + self.size return self.get_start() + self.size

View file

@ -59,7 +59,7 @@ class BasePartition(AbstractPartition):
"""Gets the starting byte of this partition """Gets the starting byte of this partition
:return: The starting byte of this partition :return: The starting byte of this partition
:rtype: Bytes :rtype: Sectors
""" """
if self.previous is None: if self.previous is None:
# If there is no previous partition, this partition begins at the offset # If there is no previous partition, this partition begins at the offset

View file

@ -9,8 +9,8 @@ class SinglePartition(AbstractPartition):
"""Gets the starting byte of this partition """Gets the starting byte of this partition
:return: The starting byte of this partition :return: The starting byte of this partition
:rtype: Bytes :rtype: Sectors
""" """
from bootstrapvz.common.bytes import Bytes from bootstrapvz.common.sectors import Sectors
# On an unpartitioned volume there is no offset and no previous partition # On an unpartitioned volume there is no offset and no previous partition
return Bytes(0) return Sectors(0, self.size.sector_size)