Package duplicity :: Module diffdir :: Class TarBlockIter
[hide private]
[frames] | no frames]

Class TarBlockIter

source code


A bit like an iterator, yield tar blocks given input iterator

Unlike an iterator, however, control over the maximum size of a tarblock is available by passing an argument to next(). Also the get_footer() is available.

Instance Methods [hide private]
 
__init__(self, input_iter)
TarBlockIter initializer
source code
 
__iter__(self) source code
 
get_footer(self)
Return closing string for tarfile, reset offset
source code
 
get_previous_index(self)
Return index of last tarblock, or None if no previous index
source code
 
next(self, size=1048576)
Return next block, no bigger than size, and update offset
source code
 
process(self, val, size)
Turn next value of input_iter into a TarBlock
source code
 
process_continued(self, size)
Get more tarblocks
source code
 
recall_index(self)
Retrieve index remembered with remember_next_index
source code
 
remember_next_index(self)
When called, remember the index of the next block iterated
source code
 
tarinfo2tarblock(self, index, tarinfo, file_data='')
Make tarblock out of tarinfo and file data
source code
Method Details [hide private]

process_continued(self, size)

source code 

Get more tarblocks

If processing val above would produce more than one TarBlock, get the rest of them by calling process_continue.