genvid.toolbox.SyncFolder

class genvid.toolbox.SyncFolder(*, cache: Optional[SyncFolderType] = None, manifest_name: str = 'genvid.manifest', logger: Optional[Logger] = None)

Bases: object

manifest_name

The name of the manifest in this folder.

logger

The logger used by this instance.

cache

A cache folder for patching.

property manifest: Manifest
load() Manifest

Load the manifest if it exists.

Returns

The folder manifest, or an empty manifest if there is no manifest.

generate() Manifest

Create a manifest from the content of the folder.

Returns

The manifest generated from the content of the folder.

save(manifest: Manifest)

Save the manifest under this folder.

Parameters

manifest – The manifest to save.

validate() Iterable[tuple[genvid.toolbox.sync.Manifest.Op, genvid.toolbox.sync.FileStats]]

Validate if the content of the folder corresponds to its manifest.

Returns

A list of operations between the folder manifest and its content.

patch_from(origin: SyncFolderType, *, dryrun: bool = False)

Patch this folder to be identical to the origin.

Parameters
  • origin – The folder to sync with.

  • dryrun – Don’t change the folder, only show the operations.

Raises

NotImplementedError – If the folder or origin are incompatible.

class sync.SyncFolder

Implementation of genvid.toolbox.SyncFolder

class sync.SyncFolderType

A TypeVar for genvid.toolbox.SyncFolder