with pyzipper.AESZipFile(
self.zip_path,
'w',
compression=pyzipper.ZIP_LZMA,
encryption=pyzipper.WZ_AES
) as zf:
zf.setpassword(self.password.encode())
if os.path.isdir(self.source):
for root, dirs, files in os.walk(self.source):
for file in files:
full_path = os.path.join(root, file)
arcname = os.path.relpath(full_path, start=self.source)
zf.write(full_path, arcname)
processed += 1
self.progress.emit(int((processed/total_files)*100))
else:
zf.write(self.source, os.path.basename(self.source))
self.progress.emit(100)