genvid.toolbox.ZipSyncFolder
- class genvid.toolbox.ZipSyncFolder
Bases:
SyncFolder
An implementation of
SyncFolder
for a read-only zip archives.- Parameters:
zip – A zip info of the archive.
writable – Allow the zip file to be modified.
Important
Python zip file routines are not able to removed old files. Instead, new entries are added with the same name, but the files are removed from the manifest and so shouldn’t appear in the destination, as long as the manifest is not regenerated.
New in version 1.46.0.
- is_thread_safe = False
If the object is thread safe
New in version 1.46.0.
- __init__(source: ZipFile, *, writable: bool = False, **kwargs)
This abstract class establishes a strategy to sync two folders using their
Manifest
and, optionally, a local cache.- Parameters:
cache – An optional
SyncFolder
that can be used as an alternative source from added files.manifest_name – Where to find the manifest in the folder.
logger – An optional parent logger. The root logger will be used if an optional logger isn’t specified.
uncheck – If true, do not use the saved manifest. Depending on the implementation, could generate a new one or just not using it.
New in version 1.42.0.
Changed in version 1.46.0: Add the uncheck parameter.
- root
The archive.
- manifest_file
The path to the manifest file.
- class sync.ZipSyncFolder
Implementation of
genvid.toolbox.ZipSyncFolder