Package duplicity :: Module tarfile :: Class TarFromIterator
[hide private]
[frames] | no frames]

Class TarFromIterator

source code


Readable tarfile-like object generated from iterator

Instance Methods [hide private]
 
__init__(self, pair_iter)
Construct a TarFromIterator instance.
source code
 
seek(self, offset)
Seek to current position.
source code
 
read(self, length=-1)
Return next length bytes, or everything if length < 0
source code
 
_addtobuffer(self)
Write more data into the buffer.
source code
 
_finish_fileobj(self)
Update some variables when done writing fileobj
source code
 
_add_final(self)
Add closing footer to buffer
source code
 
close(self)
Close file obj
source code

Inherited from TarFile: __iter__, add, addfile, extract, extractfile, getinfo, getmember, getmembers, getnames, gettarinfo, init_datastructures, list, next, throwaway_until

Class Variables [hide private]
  BEGIN = 0
  MIDDLE_OF_FILE = 1
  END = 2
  BUFFER_ADDLEN = 65536

Inherited from TarFile: debug, dereference, errorlevel, ignore_zeros

Method Details [hide private]

__init__(self, pair_iter)
(Constructor)

source code 

Construct a TarFromIterator instance. pair_iter is an iterator of (TarInfo, fileobj) objects, which fileobj should be a file-like object opened for reading, or None. The fileobjs will be closed before the next element in the iterator is read.

Overrides: TarFile.__init__

seek(self, offset)

source code 

Seek to current position. Just read and discard some amount

_addtobuffer(self)

source code 

Write more data into the buffer. Return None if at end

close(self)

source code 

Close file obj

Overrides: TarFile.close