Commit 4ceff5c4 authored by lucas.tieman's avatar lucas.tieman
Browse files

removed unused optional method parameter

parent 7215d29b
##this is a sample data set, this is not used in production
MAPP_SFTP_KEY_LOCAL_NAME="o2fTo7DAtKQWtSUc858dVxnYI1i5xPd8xw_wpR1y_sE="
MAPP_SFTP_FILE_PATTERN_LOCAL_NAME="Phil"
MAPP_SFTP_FILE_PATTERN_LOCAL_NAME="Script"
MAPP_SFTP_EMAIL_LOCAL_NAME="lucas.tieman@seiu.org"
\ No newline at end of file
......@@ -23,7 +23,7 @@ def encrypt_file(key, in_filename, out_filename=None):
out_filename:
If None, '<in_filename>.enc' will be used.
"""
if not out_filename:
if not out_filename or out_filename == in_filename:
out_filename = in_filename + '.enc'
with open(in_filename, 'rb') as infile:
......@@ -43,8 +43,8 @@ def decrypt_file(key, in_filename, out_filename=None):
(i.e. if in_filename is 'aaa.zip.enc' then
out_filename will be 'aaa.zip')
"""
if not out_filename:
out_filename = os.path.splitext(in_filename)[0]
if not out_filename or out_filename == in_filename:
out_filename = in_filename + '1'
encryptor = Fernet(key.encode('utf-8'))
with open(in_filename, 'rb') as infile:
with open(out_filename, 'wb') as outfile:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment