duplicity.patchdir module¶
-
class
duplicity.patchdir.
IndexedTuple
(index, sequence)[source]¶ Like a tuple, but has .index (used previously by collate_iters)
-
class
duplicity.patchdir.
Multivol_Filelike
(tf, tar_iter, tarinfo_list, index)[source]¶ Emulate a file like object from multivols
Maintains a buffer about the size of a volume. When it is read() to the end, pull in more volumes as desired.
-
duplicity.patchdir.
Patch
(base_path, difftar_fileobj)[source]¶ Patch given base_path and file object containing delta
-
duplicity.patchdir.
Patch_from_iter
(base_path, fileobj_iter, restrict_index=())[source]¶ Patch given base_path and iterator of delta file objects
-
class
duplicity.patchdir.
PathPatcher
(base_path)[source]¶ Bases:
duplicity.lazy.ITRBranch
Used by DirPatch, process the given basis and diff
-
class
duplicity.patchdir.
ROPath_IterWriter
(base_path)[source]¶ Bases:
duplicity.lazy.ITRBranch
Used in Write_ROPaths above
We need to use an ITR because we have to update the permissions/times of directories after we write the files in them.
-
class
duplicity.patchdir.
TarFile_FromFileobjs
(fileobj_iter)[source]¶ Like a tarfile.TarFile iterator, but read from multiple fileobjs
-
duplicity.patchdir.
Write_ROPaths
(base_path, rop_iter)[source]¶ Write out ropaths in rop_iter starting at base_path
Returns 1 if something was actually written, 0 otherwise.
-
duplicity.patchdir.
collate_iters
(iter_list)[source]¶ Collate iterators by index
Input is a list of n iterators each of which must iterate elements with an index attribute. The elements must come out in increasing order, and the index should be a tuple itself.
The output is an iterator which yields tuples where all elements in the tuple have the same index, and the tuple has n elements in it. If any iterator lacks an element with that index, the tuple will have None in that spot.
-
duplicity.patchdir.
difftar2path_iter
(diff_tarfile)[source]¶ Turn file-like difftarobj into iterator of ROPaths
-
duplicity.patchdir.
filter_path_iter
(path_iter, index)[source]¶ Rewrite path elements of path_iter so they start with index
Discard any that doesn’t start with index, and remove the index prefix from the rest.
-
duplicity.patchdir.
get_index_from_tarinfo
(tarinfo)[source]¶ Return (index, difftype, multivol) pair from tarinfo object
-
duplicity.patchdir.
integrate_patch_iters
(iter_list)[source]¶ Combine a list of iterators of ropath patches
The iter_list should be sorted in patch order, and the elements in each iter_list need to be orderd by index. The output will be an iterator of the final ROPaths in index order.
-
duplicity.patchdir.
normalize_ps
(patch_sequence)[source]¶ Given an sequence of ROPath deltas, remove blank and unnecessary
The sequence is assumed to be in patch order (later patches apply to earlier ones). A patch is unnecessary if a later one doesn’t require it (for instance, any patches before a “delete” are unnecessary).
-
duplicity.patchdir.
patch_diff_tarfile
(base_path, diff_tarfile, restrict_index=())[source]¶ Patch given Path object using delta tarfile (as in tarfile.TarFile)
If restrict_index is set, ignore any deltas in diff_tarfile that don’t start with restrict_index.