qmm.ab.archives module

class qmm.ab.archives.ABCArchiveInstance(archive_name, file_list)[source]

Bases: abc.ABC

property all_ignored

Value is True if all files of the archive are of status FILE_IGNORED.

property all_matching

Return True if all files in the archive matches on the drive.

ar_type = None
abstract conflicts()[source]

Yield FileMetadata of conflicting entries of the archive.

property empty

A boolean if wether the archive contains anything useful.

list7z will return an empty list if none of the files present in the archive are valid. That could happen for a variety of reasons, like an archive containing only folders or empty files. In those cases, the FileState for the entries won’t be set and the software won’t know what to ignore.

files(exclude_directories=False) Generator[qmm.bucket.FileMetadata, None, None][source]
find(fmd: qmm.bucket.FileMetadata)[source]

Return a FileMetadata object if managed by the archive.

The comparison is done on path and crc, not origin.

Parameters

fmd (FileMetadata) – a FileMetadata object

Returns

(FileMetadata, int)

Return type

tuple

find_metadata_by_path(path)[source]
folders() Generator[qmm.bucket.FileMetadata, None, None][source]

Yield folders present in the archive.

get_status(file: qmm.bucket.FileMetadata) qmm.fileutils.FileState[source]
property has_conflicts

Value is True if conflicts exists for this archive.

property has_ignored

Value is True if a file of the archive is of status FILE_IGNORED.

property has_matched

Return True if a file of the archive is of status FILE_MATCHED.

property has_mismatched

Value is True if a file of the archive is of status FILE_MISMATCHED.

property has_missing

Value is True if a file of the archive is of status FILE_MISSING.

abstract ignored() Iterable[qmm.bucket.FileMetadata][source]

Yield file metadata of ignored entries of the archive.

abstract install_info()[source]
abstract matched() Generator[qmm.bucket.FileMetadata, None, None][source]

Yield file metadata of matched entries of the archive.

abstract mismatched() Generator[qmm.bucket.FileMetadata, None, None][source]

Yield file metadata of mismatched entries of the archive.

abstract missing() Generator[qmm.bucket.FileMetadata, None, None][source]

Yield file metadata of missing entries of the archive.

abstract reset_conflicts()[source]
reset_status()[source]

Called whenever the state of an archive becomes dirty, which is also the default state.

Populate ‘self._meta’ with tuples containing the ‘FileMetadata’ object of each individual file alongside the current status of that file. The status can be either FILE_MATCHED, FILE_MISMATCHED, FILE_IGNORED or FILE_MISSING.

status() Generator[Tuple[qmm.bucket.FileMetadata, int], None, None][source]
abstract uninstall_info()[source]

Informations necessary to the uninstall function.

class qmm.ab.archives.ArchiveType(value)[source]

Bases: enum.IntEnum

An enumeration.

FILE = 1
VIRTUAL = 2