l.a.p.ByHash : class documentation

Part of lp.archivepublisher.publishing View In Hierarchy

Represents a single by-hash directory tree.
Method __init__ Undocumented
Method add Ensure that by-hash entries for a single file exist.
Method known Do we know about a file with this name and digest?
Method prune Remove all by-hash entries that we have not been told to add.
Method _usable_archive_hashes Undocumented
def __init__(self, root, key, log):
Undocumented
@property
def _usable_archive_hashes(self):
Undocumented
def add(self, name, lfa, copy_from_path=None):
Ensure that by-hash entries for a single file exist.
ParametersnameThe name of the file under this directory tree.
lfaThe ILibraryFileAlias to add.
copy_from_pathIf not None, copy file content from here rather than fetching it from the librarian. This can be used for newly-added files to avoid needing to commit the transaction before calling this method.
def known(self, name, hashname, digest):
Do we know about a file with this name and digest?
def prune(self):
Remove all by-hash entries that we have not been told to add.

This also removes the by-hash directory itself if no entries remain.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.