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