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

Class TarInfo

source code


Informational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally.

Instance Methods [hide private]
 
__init__(self, name='')
Construct a TarInfo object.
source code
 
_getpath(self) source code
 
_setpath(self, name) source code
 
_getlinkpath(self) source code
 
_setlinkpath(self, linkname) source code
 
__repr__(self)
repr(x)
source code
 
get_info(self, encoding, errors)
Return the TarInfo's attributes as a dictionary.
source code
 
tobuf(self, format=1, encoding='UTF-8', errors='strict')
Return a tar header as a string of 512 byte blocks.
source code
 
create_ustar_header(self, info)
Return the object as a ustar header block.
source code
 
create_gnu_header(self, info)
Return the object as a GNU header block sequence.
source code
 
create_pax_header(self, info, encoding, errors)
Return the object as a ustar header block.
source code
 
_posix_split_name(self, name)
Split a name longer than 100 chars into a prefix and a name part.
source code
 
_proc_member(self, tarfile)
Choose the right processing method depending on the type and call it.
source code
 
_proc_builtin(self, tarfile)
Process a builtin type or an unknown type which will be treated as a regular file.
source code
 
_proc_gnulong(self, tarfile)
Process the blocks that hold a GNU longname or longlink member.
source code
 
_proc_sparse(self, tarfile)
Process a GNU sparse header plus extra headers.
source code
 
_proc_pax(self, tarfile)
Process an extended or global header as described in POSIX.1-2001.
source code
 
_apply_pax_info(self, pax_headers, encoding, errors)
Replace fields with supplemental information from a previous pax extended or global header.
source code
 
_block(self, count)
Round up a byte count by BLOCKSIZE and return it, e.g.
source code
 
isreg(self) source code
 
isfile(self) source code
 
isdir(self) source code
 
issym(self) source code
 
islnk(self) source code
 
ischr(self) source code
 
isblk(self) source code
 
isfifo(self) source code
 
issparse(self) source code
 
isdev(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
create_pax_global_header(cls, pax_headers)
Return the object as a pax global header block sequence.
source code
 
_create_gnu_long_header(cls, name, type)
Return a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name.
source code
 
_create_pax_generic_header(cls, pax_headers, type='x')
Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs.
source code
 
frombuf(cls, buf)
Construct a TarInfo object from a 512 byte string buffer.
source code
 
fromtarfile(cls, tarfile)
Return the next TarInfo object from TarFile object tarfile.
source code
Static Methods [hide private]
 
_create_header(info, format)
Return a header block.
source code
 
_create_payload(payload)
Return the string payload filled with zero bytes up to the next 512 byte border.
source code
Properties [hide private]
  path
  linkpath

Inherited from object: __class__

Method Details [hide private]

__init__(self, name='')
(Constructor)

source code 

Construct a TarInfo object. name is the optional name of the member.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

create_pax_header(self, info, encoding, errors)

source code 

Return the object as a ustar header block. If it cannot be represented this way, prepend a pax extended header sequence with supplement information.

_create_header(info, format)
Static Method

source code 

Return a header block. info is a dictionary with file information, format must be one of the *_FORMAT constants.

_create_pax_generic_header(cls, pax_headers, type='x')
Class Method

source code 

Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs. The values must be unicode objects.

_block(self, count)

source code 

Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024.


Property Details [hide private]

path

Get Method:
_getpath(self)
Set Method:
_setpath(self, name)

linkpath

Get Method:
_getlinkpath(self)
Set Method:
_setlinkpath(self, linkname)