Refactored to use AbstractSplittedSecret

This commit is contained in:
Kevin Veen-Birkenbach 2022-12-09 13:08:07 +01:00
parent 16040178e5
commit f547b79675
5 changed files with 23 additions and 12 deletions

View File

@ -0,0 +1,3 @@
class AbstractSplittedSecret:
def __init__(self):
self.encrypted_splitted_password_files_folder = "data/encrypted/splitted_password_files/"

View File

@ -0,0 +1,7 @@
from .AbstractSplittedSecret import AbstractSplittedSecret
class Cleanup(AbstractSplittedSecret):
def __init__(self):
pass
def deleteAll(self):
pass

View File

@ -3,7 +3,7 @@
import subprocess
class Cli():
class Cli(object):
def __init__(self):
self.command = ''

View File

@ -1,18 +1,19 @@
import argparse
from classes.Generate import Generate
from classes.Cleanup import Cleanup
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--amount',type=int, dest='amount_of_secret_holders',required=True,choices=range(1,9))
parser.add_argument('-q', '--quota', type=int, dest='decryption_quota', choices=range(1,101),required=True)
#parser.add_argument('-p', '--master-password', type=str, dest='master_password', required=False)
parser.add_argument('-m', '--mode',type=str, dest='mode',required=True,choices=['cleanup','generate'])
parser.add_argument('-a', '--amount',type=int, dest='amount_of_secret_holders',required=False,choices=range(1,9))
parser.add_argument('-q', '--quota', type=int, dest='decryption_quota', choices=range(1,101),required=False)
args = parser.parse_args()
#master_password = args.master_password
if args.mode == 'cleanup':
cleanup = Cleanup()
exit()
if args.mode == 'generate':
generate = Generate(args.amount_of_secret_holders, args.decryption_quota)
generate.execute()
#savePassword(master_password,decrypted_master_password_file_path)
#print(password_groups)
exit()