Abstract Python Module

Module for the Abstract Classes.

Abstract Backend Module.

Module that has the Abstract class for Archive Backends Any new backends need to inherit from this class and implement its methods. If the methods are not implemented in the child, the child object will not be able to be instantiated.

class pacifica.archiveinterface.backends.abstract.archive.AbstractBackendArchive(prefix)[source]

Abstract Base Class for Archive Backends.

__init__(prefix)[source]

Constructor to build backend archive.

__metaclass__

alias of abc.ABCMeta

__weakref__

list of weak references to the object (if defined)

close()[source]

Close File.

Method that closes an open file for the backend archive that implements this class.

open(filepath, mode)[source]

Open File.

Method that opens a file for the backend archive that implements this class Should return a file like object, most likely self. This method is also responsible for making sure the dirname of the filepath exists before trying to open.

patch(file_id, old_path)[source]

Move a file.

read(blocksize)[source]

Read File.

Method that reads an open file for the backend archive that implements this class and returns the contents.

remove()[source]

Remove a file.

set_file_permissions()[source]

Set permissions for File.

Method that sets a files permissions for the backend archive that implements this class.

set_mod_time(mod_time)[source]

Set Modification Time for File.

Method that sets a files mod time for the backend archive that implements this class.

stage()[source]

Stage File.

Method that stages a file for the the backend that implements this class Stage moves a file to an appropriate location to be downloaded.

status()[source]

Return status of the file.

Method that gets the status of a file in the archive Needs to return an implemented object of the abstract_status_class The abstract_status_class should be implemented for each backend type.

write(buf)[source]

Write File.

Method that writes an open file for the backend archive that implements this class.

Module that has the abstract class for a file’s status.

class pacifica.archiveinterface.backends.abstract.status.AbstractStatus(mtime, ctime, bytes_per_level, filesize)[source]

Abstract Base Class for Status.

Child backend objects need to implement the following methods to allow file status to function.

__init__(mtime, ctime, bytes_per_level, filesize)[source]

Constructor for AbstractClass.

Implemented versions of this class need to set all the attributes defined in this abstract class.

__metaclass__

alias of abc.ABCMeta

__weakref__

list of weak references to the object (if defined)

define_levels()[source]

Defined list of levels.

Method that defines the storage levels in the archive backend. So a backend archive with a disk, tape, and error drive will return the following [“disk”, “tape”, “error”].

find_file_storage_media()[source]

Find File Storage Media.

Method that finds the media the file in the archive backend is stored on. Usually disk or tape.

set_filepath(filepath)[source]

Set File Path.

Method that sets the filepath class attribute. Used to return the correct status of a file.