INNER CODE UNIT · Python
CygTar
DaemonEngine/Daemon · external_deps/cygtar.py:149
class CygTar(object):
""" CygTar is an object which represents a Win32 and Cygwin aware tarball."""
def __init__(self, filename, mode='r', verbose=False):
self.size_map = {}
self.file_hashes = {}
# Set errorlevel=1 so that fatal errors actually raise!
self.tar = tarfile.open(filename, mode, errorlevel=1)
self.verbose = verbose
def __DumpInfo(self, tarinfo):
"""Prints information on a single object in the tarball."""
typeinfo = '?'
lnk = ''
if tarinfo.issym():
typeinfo = 'S'
lnk = '-> ' + tarinfo.linkname
if tarinfo.islnk():
typeinfo = 'H'