Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
antonvolokha committed Feb 28, 2024
1 parent 0f606c8 commit d3fb3fc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/encryption_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ def decrypt(self):
with open(self.input_file, 'rb') as infile:
file = []
for line in infile.readlines():
if delimiter_encoded in line:
metadata = FileMetaData(json_data=line.replace(delimiter_encoded, ''.encode()))
if delimiter_encoded not in line:
file.append(line)
continue

if metadata.is_zip():
self.zip_file = metadata
with open(metadata.filepath, 'wb') as outfile:
outfile.writelines(file)
metadata = FileMetaData(json_data=line.replace(delimiter_encoded, ''.encode()))

unzip_to_directory(metadata.filepath, self.passphrase)
if metadata.is_zip():
self.zip_file = metadata
with open(metadata.filepath, 'wb') as outfile:
outfile.writelines(file)

file = []
continue
unzip_to_directory(metadata.filepath, self.passphrase)

file.append(line)
file = []
except BadPasswordException as e:
self.clear()
raise e
Expand Down

0 comments on commit d3fb3fc

Please sign in to comment.