exlab_wizard.sync.manifest#
Parser for rclone lsjson output into a run-relative remote manifest.
Sole owner of the lsjson wire shape. Consumers (the NAS sync client’s
routine reconcile and cleanup remote-existence probe) depend only on the
RemoteManifest value object, never on the raw JSON.
Functions
|
Parse |
Classes
|
One file on the remote. |
|
Run-relative view of a remote subtree. |
- class exlab_wizard.sync.manifest.RemoteEntry(size, mod_time, is_dir)[source]#
Bases:
objectOne file on the remote.
mod_timeis the RFC3339 string as emitted.
- class exlab_wizard.sync.manifest.RemoteManifest(entries)[source]#
Bases:
objectRun-relative view of a remote subtree. Keyed by POSIX rel-path.
- Parameters:
entries (
dict[str,RemoteEntry])
- entries: dict[str, RemoteEntry]#
- matches(rel_path, local_size, local_mtime, *, tolerance_s)[source]#
The single reconcile predicate: present AND size-equal AND modtime close.
local_mtimeis the local file’sst_mtime(epoch seconds). A file is credited as synced only when the remote entry exists, its size equalslocal_size, and its modtime is withintolerance_sof local (rclone preserves modtime on copy; the window absorbs SFTP/SMB rounding).
- exlab_wizard.sync.manifest.parse_lsjson(raw, *, strip_prefix='')[source]#
Parse
rclone lsjsonarray text into aRemoteManifest.Directory entries are dropped.
strip_prefix(e.g.<base_root>/<equipment_id>/<run>) is removed from eachPathso keys are run-relative. Malformed / empty input yields an empty manifest (logged at debug) rather than raising — a listing we can’t parse must not crash the sync worker.- Parameters:
- Return type: