friendlypics.manifest_file module

class friendlypics.manifest_file.ManifestFile(file_name)[source]

Bases: object

Interface for manipulating a friendlypics manifest file

Args:

file_name (str): path to the manifest file to parse

add_entry(file)[source]

Adds a new entry to the manifest

Args:

file (FileObj): file to reference in the manifest

contains(file)[source]

Checks to see whether a file exists in this manifest

Args:

file (FileObj): file to locate

Returns:
bool:

True if there is any file with a matching checksum file to the source file tracked by this manifest file, False if not

find_matches(file)[source]

Locates any files defined in this manifest that match a source file

Args:

file (FileObj): file to locate

Returns:
list:

0 or more files that match either the checksum or the file name of the source file. Typically returns 0, 1 or 2 matches. 0 if there are no similar files in the manifest. 1 if there is a file with the same name and/or the same checksum as the source file. 2 if there is both a file with the same file name but a different checksum AND a file with the same checksum but a different filename.

path

str: path to the manifest file managed by this object