Back to bricks list
Introduction
Technical Documentation
Other Classes
Compress ZipCompress
Version

ZipCompress

Class to zip and unzip files and folders

Attributes

destination_file_path: strzipf: ZipFile

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

Unzip a 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