added while loop for top level config menu, updated delete question to standard we are using
This commit is contained in:
@@ -113,11 +113,12 @@ if __name__ == "__main__":
|
||||
sys.exit(0)
|
||||
else:
|
||||
print("This value must be one of the following characters: n, q.")
|
||||
|
||||
while True:
|
||||
config = configparser.ConfigParser()
|
||||
config.read(secrets_ini_file)
|
||||
accounts = config.sections()
|
||||
print("Current Bitwarden accounts:")
|
||||
print(" ")
|
||||
for account in accounts:
|
||||
print(account)
|
||||
print(" ")
|
||||
@@ -128,7 +129,7 @@ if __name__ == "__main__":
|
||||
while True:
|
||||
user_input = input("e/n/d/q> ")
|
||||
if user_input.casefold() == "e":
|
||||
print("")
|
||||
account_section_to_edit = select_account(accounts)
|
||||
elif user_input.casefold() == "n":
|
||||
account_details = ask_for_account_details()
|
||||
config.add_section(account_details["account_email_address"])
|
||||
@@ -140,7 +141,8 @@ if __name__ == "__main__":
|
||||
break
|
||||
elif user_input.casefold() == "d":
|
||||
account_section_to_delete = select_account(accounts, "delete")
|
||||
confirmation = input("Are you sure you wish to delete {} account?".format(account_section_to_delete))
|
||||
print("Are you sure you wish to delete {} account? ".format(account_section_to_delete))
|
||||
confirmation = input("y/n> ")
|
||||
if not confirmation.casefold() in ["y","yes"]:
|
||||
break
|
||||
config.remove_section(account_section_to_delete)
|
||||
|
||||
Reference in New Issue
Block a user