2018-02-12 04:17:53 +00:00
|
|
|
from .base import BasePartition
|
2014-01-19 01:02:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
class UnformattedPartition(BasePartition):
|
2016-06-04 11:35:59 +02:00
|
|
|
"""Represents an unformatted partition
|
|
|
|
It cannot be mounted
|
|
|
|
"""
|
2014-01-19 01:02:29 +01:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
# The states for our state machine. It can only be mapped, not mounted.
|
|
|
|
events = [{'name': 'create', 'src': 'nonexistent', 'dst': 'unmapped'},
|
|
|
|
{'name': 'map', 'src': 'unmapped', 'dst': 'mapped'},
|
|
|
|
{'name': 'unmap', 'src': 'mapped', 'dst': 'unmapped'},
|
|
|
|
]
|
2014-01-19 01:02:29 +01:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
def __init__(self, size, previous):
|
|
|
|
"""
|
|
|
|
:param Bytes size: Size of the partition
|
|
|
|
:param BasePartition previous: The partition that preceeds this one
|
|
|
|
"""
|
2016-12-10 16:03:02 +01:00
|
|
|
super(UnformattedPartition, self).__init__(size, None, None, None, previous)
|