Package duplicity :: Module misc :: Class FileVolumeWriter
[hide private]
[frames] | no frames]

Class FileVolumeWriter

source code

Split up an incoming fileobj into multiple volumes on disk

This class can also be used as an iterator. It returns the filenames of the files it writes.

Instance Methods [hide private]
 
__init__(self, infp, file_prefix)
FileVolumeWriter initializer
source code
 
get_initial_buf(self)
Get first value of buffer, from self.buffer or infp
source code
 
write_volume(self, outfp)
Write self.volume_size bytes from self.infp to outfp
source code
 
next(self)
Write next file, return filename
source code
 
__iter__(self) source code
Class Variables [hide private]
  volume_size = 52428800
  blocksize = 65536
Method Details [hide private]

__init__(self, infp, file_prefix)
(Constructor)

source code 

FileVolumeWriter initializer

infp is a file object opened for reading. It will be closed at end. file_prefix is the full path of the volumes that will be written. If more than one is required, it will be appended with .1, .2, etc.

write_volume(self, outfp)

source code 

Write self.volume_size bytes from self.infp to outfp

Return None if we have reached end of infp without reaching volume size, and false otherwise.