Back to bricks list
Introduction Version

TarCompress

Class to compress and uncompress tar file.

:return: description :rtype: type

Attributes

compress_option: strdestination_file_path: strtar_file: TarFile

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

Parameters:
NameTypeDefault valueDescription
destination_file_pathstr
ADD_DIR
Parameters:
NameTypeDefault valueDescription
dir_pathstr
dir_namestr
ADD_FILE
Parameters:
NameTypeDefault valueDescription
file_pathstr
file_namestr
ADD_FS_NODE
Parameters:
NameTypeDefault valueDescription
fs_node_pathstr
fs_node_namestr
CLOSE
Return type:
str
CAN_UNCOMPRESS_FILE - @classmethod

Return true if the file can be uncompressed by this class

Parameters:
NameTypeDefault valueDescription
file_pathstr
Return type:
bool
COMPRESS_DIR - @classmethod

Compress a folder into a tar.gz file.

Parameters:
NameTypeDefault valueDescription
dir_pathstr
destination_file_pathstr Path of the tar.gz file to create ``
DECOMPRESS - @classmethod

Uncompress a tar.gz file.

Parameters:
NameTypeDefault valueDescription
file_pathstr
destination_folderstr
GET_SUPPORTED_EXTENSIONS - @classmethod

Return the list of supported extensions

Return type:
set
GET_ALL_SUPPORTED_EXTENSIONS - @staticmethod

Return the list of all supported extensions without '.'

Return type:
Set
IS_COMPRESSED_FILE - @staticmethod

Check if the file is a compressed file.

Parameters:
NameTypeDefault valueDescription
file_pathstr
Return type:
bool
SMART_DECOMPRESS - @staticmethod

Detect the extension of the compressed file and use the right decompress method.

Parameters:
NameTypeDefault valueDescription
file_pathstr
destination_folderstr