duplicity.librsync module

Provides a high-level interface to some librsync functions

This is a python wrapper around the lower-level _librsync module, which is written in C. The goal was to use C as little as possible...

class duplicity.librsync.DeltaFile(signature, new_file)[source]

Bases: duplicity.librsync.LikeFile

File-like object which incrementally generates a librsync delta

class duplicity.librsync.LikeFile(infile, need_seek=None)[source]

File-like object used by SigFile, DeltaFile, and PatchFile

check_file(file, need_seek=None)[source]

Raise type error if file doesn’t have necessary attributes

close()[source]

Close infile

maker = None
mode = 'rb'
read(length=-1)[source]

Build up self.outbuf, return first length bytes

class duplicity.librsync.PatchedFile(basis_file, delta_file)[source]

Bases: duplicity.librsync.LikeFile

File-like object which applies a librsync delta incrementally

class duplicity.librsync.SigFile(infile, blocksize=2048)[source]

Bases: duplicity.librsync.LikeFile

File-like object which incrementally generates a librsync signature

class duplicity.librsync.SigGenerator(blocksize=2048)[source]

Calculate signature.

Input and output is same as SigFile, but the interface is like md5 module, not filelike object

getsig()[source]

Return signature over given data

process_buffer()[source]

Run self.buffer through sig_maker, add to self.sig_string

update(buf)[source]

Add buf to data that signature will be calculated over

exception duplicity.librsync.librsyncError[source]

Bases: exceptions.Exception

Signifies error in internal librsync processing (bad signature, etc.)

underlying _librsync.librsyncError’s are regenerated using this class because the C-created exceptions are by default unPickleable. There is probably a way to fix this in _librsync, but this scheme was easier.