def serialize_tar_info(tar_info):
 is_deleted = False
 filename = tar_info.name
 if (filename == '.'):
  filename = '/'
 if filename.startswith('./'):
  filename = ('/' + filename[2:])
 if filename.startswith('/.wh.'):
  filename = ('/' + filename[5:])
  is_deleted = True
 if filename.startswith('/.wh.'):
  return None
 return (filename, FILE_TYPES.get(tar_info.type, 'u'), is_deleted, tar_info.size, tar_info.mtime, tar_info.mode, tar_info.uid, tar_info.gid)

def serialize_tar_info ( tar_info ) : is_deleted = False filename = tar_info . name if ( filename == '.' ) : filename = '/' if filename . startswith ( './' ) : filename = ( '/' + filename [ 2 : ] ) if filename . startswith ( '/.wh.' ) : filename = ( '/' + filename [ 5 : ] ) is_deleted = True if filename . startswith ( '/.wh.' ) : return None return ( filename , FILE_TYPES . get ( tar_info . type , 'u' ) , is_deleted , tar_info . size , tar_info . mtime , tar_info . mode , tar_info . uid , tar_info . gid )
serialize a tarfile .