#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Posix Status Module.
Module that implements the Abstract Status class for the posix
archive backend type.
"""
from ..abstract.status import AbstractStatus
[docs]class PosixStatus(AbstractStatus):
"""Posix Status Class.
Class for handling posix status pieces
needs mtime,ctime, bytes per level array.
"""
_disk = 'disk'
[docs] def __init__(self, mtime, ctime, bytes_per_level, filesize):
"""Constructor for posix status class."""
super(PosixStatus, self).__init__(
mtime,
ctime,
bytes_per_level,
filesize
)
self.mtime = mtime
self.ctime = ctime
self.bytes_per_level = bytes_per_level
self.filesize = filesize
self.filepath = None
self.defined_levels = self.define_levels()
self.file_storage_media = self.find_file_storage_media()
[docs] def define_levels(self):
"""Set up what each level definition means."""
# This defines posix integer levels. Always disk
type_per_level = [self._disk]
return type_per_level
[docs] def set_filepath(self, filepath):
"""Set the filepath that the status is for."""
self.filepath = filepath