2019-11-10, 18:52
I made a simple archive module for my own uses. Posting it here in case other addon creators would find it useful.
script.module.archive_tool
Usage:
script.module.archive_tool
Usage:
python:
import archive_tool
my_archive = archive_tool.archive_tool(archive_file = 'myfile.zip',directory_out = '/my/output_directory/') #Current archive object
file_listing = my_archive.list_all() #Lists all files in the archive
file_listing_dict = my_archive.stat_all() #Dict of all files in the archive containing fullpath, filename, file size (extracted)
files_extracted, success_of_extraction = my_archive.extract() #Extracts all files to directory_out, returns list of files extracted and True/False for extraction success. Defaults to extract all files in the archive.