diff --git a/README.md b/README.md index b0cdf40..fe394ce 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ You can install the FFLocker via `pip` python3 -m pip install fflocker -or by directly cloning to your desired directory. +or by directly cloning to your desired directory git clone https://github.com/seVenVo1d/FFLocker.git diff --git a/fflocker/file_locker.py b/fflocker/file_locker.py index ac7ffc5..010527a 100644 --- a/fflocker/file_locker.py +++ b/fflocker/file_locker.py @@ -5,6 +5,7 @@ import os import secrets import sys + from string import ascii_letters from time import sleep @@ -194,25 +195,24 @@ def run_filelocker_decryption(): print('Please enter the correct password') -def run_filelocker(): - print('Starting File Locker...') - for _ in range(15): - sys.stdout.write(next(spinner)) - sys.stdout.flush() - sleep(0.1) - sys.stdout.write('\b') - print('Do you want to encrypt or decrypt the file?') - print('[e]: encrypt\t[d]: decrypt') - flag_method = True - while flag_method: - answer = input('') - if answer != 'e' and answer != 'd': - print('ERROR: Please type one of the commands given above!') - else: - flag_method = False - if answer == 'e': - run_filelocker_encryption() - elif answer == 'd': - run_filelocker_decryption() - -run_filelocker() +# ========== fflocker.file_locker ========== + +print('Starting File Locker...') +for _ in range(15): + sys.stdout.write(next(spinner)) + sys.stdout.flush() + sleep(0.1) + sys.stdout.write('\b') +print('Do you want to encrypt or decrypt the file?') +print('[e]: encrypt\t[d]: decrypt') +flag_method = True +while flag_method: + answer = input('') + if answer != 'e' and answer != 'd': + print('ERROR: Please type one of the commands given above!') + else: + flag_method = False +if answer == 'e': + run_filelocker_encryption() +elif answer == 'd': + run_filelocker_decryption() diff --git a/fflocker/folder_locker.py b/fflocker/folder_locker.py index 414c1c8..ba0505b 100644 --- a/fflocker/folder_locker.py +++ b/fflocker/folder_locker.py @@ -6,6 +6,7 @@ import secrets import shutil import sys + from pathlib import Path from string import ascii_letters from time import sleep @@ -238,25 +239,24 @@ def run_folderlocker_decryption(): shutil.rmtree(encfolderPATH[:-3], ignore_errors=True) -def run_folderlocker(): - print('Starting Folder Locker...') - for _ in range(15): - sys.stdout.write(next(spinner)) - sys.stdout.flush() - sleep(0.1) - sys.stdout.write('\b') - print('Do you want to encrypt or decrypt the folder?') - print('[e]: encrypt\t[d]: decrypt') - flag_method = True - while flag_method: - answer = input('') - if answer != 'e' and answer != 'd': - print('ERROR: Please type one of the commands given above!') - else: - flag_method = False - if answer == 'e': - run_folderlocker_encryption() - elif answer == 'd': - run_folderlocker_decryption() - -run_folderlocker() +# ========== fflocker.folder_locker ========== + +print('Starting Folder Locker...') +for _ in range(15): + sys.stdout.write(next(spinner)) + sys.stdout.flush() + sleep(0.1) + sys.stdout.write('\b') +print('Do you want to encrypt or decrypt the folder?') +print('[e]: encrypt\t[d]: decrypt') +flag_method = True +while flag_method: + answer = input('') + if answer != 'e' and answer != 'd': + print('ERROR: Please type one of the commands given above!') + else: + flag_method = False +if answer == 'e': + run_folderlocker_encryption() +elif answer == 'd': + run_folderlocker_decryption()