twindb_backup.modifiers package

Submodules

twindb_backup.modifiers.base module

Module defines Modifier() base class and its errors.

class twindb_backup.modifiers.base.Modifier(input_stream)[source]

Bases: object

Base Modifier class

callback(**kwargs)[source]

Method that will be called after the stream ends

get_stream(**kwds)[source]

Compress the input stream and return it as the output stream

Returns:output stream handle
input
Returns:Input stream to be modified
revert_stream(**kwds)[source]

Un-Apply modifier and return output stream. The Base modifier does nothing, so it will return the input stream without modifications

Returns:output stream handle

twindb_backup.modifiers.gpg module

Module defines modifier that implements asymmetric encryption with gpg

class twindb_backup.modifiers.gpg.Gpg(input_stream, recipient, keyring, secret_keyring=None)[source]

Bases: twindb_backup.modifiers.base.Modifier

Asymmetric encryption

twindb_backup.modifiers.gzip module

Module defines modifier that compresses a stream with gzip

class twindb_backup.modifiers.gzip.Gzip(input_stream, level=9)[source]

Bases: twindb_backup.modifiers.base.Modifier

Modifier that compresses the input_stream with gzip.

suffix = '.gz'

twindb_backup.modifiers.keeplocal module

Module defines modifier that save a stream on the local file system

class twindb_backup.modifiers.keeplocal.KeepLocal(input_stream, local_path)[source]

Bases: twindb_backup.modifiers.base.Modifier

KeepLocal() class saves a copy of the stream on the local file system. It doesn’t alter the stream.

callback(**kwargs)[source]

Method that will be called after the stream ends

Module contents

Modifiers module.

Modifier take a stream as input, do something with it (compress, encrypt, etc) and return the modified stream for a next modifier or backup destination.

Modifiers also do reverse operation - i.e. decompress, decrypt.