mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 15:58:48 +00:00
Add pauses in search and settings menus
This commit is contained in:
14
src/main.py
14
src/main.py
@@ -663,36 +663,50 @@ def handle_settings(password_manager: PasswordManager) -> None:
|
|||||||
choice = input("Select an option: ").strip()
|
choice = input("Select an option: ").strip()
|
||||||
if choice == "1":
|
if choice == "1":
|
||||||
handle_profiles_menu(password_manager)
|
handle_profiles_menu(password_manager)
|
||||||
|
pause()
|
||||||
elif choice == "2":
|
elif choice == "2":
|
||||||
handle_nostr_menu(password_manager)
|
handle_nostr_menu(password_manager)
|
||||||
|
pause()
|
||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
password_manager.change_password()
|
password_manager.change_password()
|
||||||
|
pause()
|
||||||
elif choice == "4":
|
elif choice == "4":
|
||||||
password_manager.handle_verify_checksum()
|
password_manager.handle_verify_checksum()
|
||||||
|
pause()
|
||||||
elif choice == "5":
|
elif choice == "5":
|
||||||
password_manager.handle_update_script_checksum()
|
password_manager.handle_update_script_checksum()
|
||||||
|
pause()
|
||||||
elif choice == "6":
|
elif choice == "6":
|
||||||
password_manager.handle_backup_reveal_parent_seed()
|
password_manager.handle_backup_reveal_parent_seed()
|
||||||
|
pause()
|
||||||
elif choice == "7":
|
elif choice == "7":
|
||||||
password_manager.handle_export_database()
|
password_manager.handle_export_database()
|
||||||
|
pause()
|
||||||
elif choice == "8":
|
elif choice == "8":
|
||||||
path = input("Enter path to backup file: ").strip()
|
path = input("Enter path to backup file: ").strip()
|
||||||
if path:
|
if path:
|
||||||
password_manager.handle_import_database(Path(path))
|
password_manager.handle_import_database(Path(path))
|
||||||
|
pause()
|
||||||
elif choice == "9":
|
elif choice == "9":
|
||||||
password_manager.handle_export_totp_codes()
|
password_manager.handle_export_totp_codes()
|
||||||
|
pause()
|
||||||
elif choice == "10":
|
elif choice == "10":
|
||||||
handle_set_additional_backup_location(password_manager)
|
handle_set_additional_backup_location(password_manager)
|
||||||
|
pause()
|
||||||
elif choice == "11":
|
elif choice == "11":
|
||||||
handle_set_inactivity_timeout(password_manager)
|
handle_set_inactivity_timeout(password_manager)
|
||||||
|
pause()
|
||||||
elif choice == "12":
|
elif choice == "12":
|
||||||
password_manager.lock_vault()
|
password_manager.lock_vault()
|
||||||
print(colored("Vault locked. Please re-enter your password.", "yellow"))
|
print(colored("Vault locked. Please re-enter your password.", "yellow"))
|
||||||
password_manager.unlock_vault()
|
password_manager.unlock_vault()
|
||||||
|
pause()
|
||||||
elif choice == "13":
|
elif choice == "13":
|
||||||
handle_display_stats(password_manager)
|
handle_display_stats(password_manager)
|
||||||
|
pause()
|
||||||
elif choice == "14":
|
elif choice == "14":
|
||||||
handle_toggle_secret_mode(password_manager)
|
handle_toggle_secret_mode(password_manager)
|
||||||
|
pause()
|
||||||
elif choice == "15":
|
elif choice == "15":
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
@@ -963,10 +963,12 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error during password generation: {e}", exc_info=True)
|
logging.error(f"Error during password generation: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to generate password: {e}", "red"))
|
print(colored(f"Error: Failed to generate password: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def handle_add_totp(self) -> None:
|
def handle_add_totp(self) -> None:
|
||||||
"""Add a TOTP entry either derived from the seed or imported."""
|
"""Add a TOTP entry either derived from the seed or imported."""
|
||||||
@@ -1018,6 +1020,7 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
break
|
break
|
||||||
elif choice == "2":
|
elif choice == "2":
|
||||||
raw = input("Paste otpauth URI or secret: ").strip()
|
raw = input("Paste otpauth URI or secret: ").strip()
|
||||||
@@ -1055,6 +1058,7 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
break
|
break
|
||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
print(colored(f"Error: {err}", "red"))
|
print(colored(f"Error: {err}", "red"))
|
||||||
@@ -1065,6 +1069,7 @@ class PasswordManager:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error during TOTP setup: {e}", exc_info=True)
|
logging.error(f"Error during TOTP setup: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to add TOTP: {e}", "red"))
|
print(colored(f"Error: Failed to add TOTP: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def handle_add_ssh_key(self) -> None:
|
def handle_add_ssh_key(self) -> None:
|
||||||
"""Add an SSH key pair entry and display the derived keys."""
|
"""Add an SSH key pair entry and display the derived keys."""
|
||||||
@@ -1102,9 +1107,11 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error during SSH key setup: {e}", exc_info=True)
|
logging.error(f"Error during SSH key setup: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to add SSH key: {e}", "red"))
|
print(colored(f"Error: Failed to add SSH key: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def handle_add_seed(self) -> None:
|
def handle_add_seed(self) -> None:
|
||||||
"""Add a derived BIP-39 seed phrase entry."""
|
"""Add a derived BIP-39 seed phrase entry."""
|
||||||
@@ -1156,9 +1163,11 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error during seed phrase setup: {e}", exc_info=True)
|
logging.error(f"Error during seed phrase setup: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to add seed phrase: {e}", "red"))
|
print(colored(f"Error: Failed to add seed phrase: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def handle_add_pgp(self) -> None:
|
def handle_add_pgp(self) -> None:
|
||||||
"""Add a PGP key entry and display the generated key."""
|
"""Add a PGP key entry and display the generated key."""
|
||||||
@@ -1207,9 +1216,11 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error during PGP key setup: {e}", exc_info=True)
|
logging.error(f"Error during PGP key setup: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to add PGP key: {e}", "red"))
|
print(colored(f"Error: Failed to add PGP key: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def handle_add_nostr_key(self) -> None:
|
def handle_add_nostr_key(self) -> None:
|
||||||
"""Add a Nostr key entry and display the derived keys."""
|
"""Add a Nostr key entry and display the derived keys."""
|
||||||
@@ -1249,9 +1260,11 @@ class PasswordManager:
|
|||||||
f"Failed to post updated index to Nostr: {nostr_error}",
|
f"Failed to post updated index to Nostr: {nostr_error}",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
pause()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error during Nostr key setup: {e}", exc_info=True)
|
logging.error(f"Error during Nostr key setup: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to add Nostr key: {e}", "red"))
|
print(colored(f"Error: Failed to add Nostr key: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def show_entry_details_by_index(self, index: int) -> None:
|
def show_entry_details_by_index(self, index: int) -> None:
|
||||||
"""Display entry details using :meth:`handle_retrieve_entry` for the
|
"""Display entry details using :meth:`handle_retrieve_entry` for the
|
||||||
@@ -1839,11 +1852,13 @@ class PasswordManager:
|
|||||||
query = input("Enter search string: ").strip()
|
query = input("Enter search string: ").strip()
|
||||||
if not query:
|
if not query:
|
||||||
print(colored("No search string provided.", "yellow"))
|
print(colored("No search string provided.", "yellow"))
|
||||||
|
pause()
|
||||||
return
|
return
|
||||||
|
|
||||||
results = self.entry_manager.search_entries(query)
|
results = self.entry_manager.search_entries(query)
|
||||||
if not results:
|
if not results:
|
||||||
print(colored("No matching entries found.", "yellow"))
|
print(colored("No matching entries found.", "yellow"))
|
||||||
|
pause()
|
||||||
return
|
return
|
||||||
|
|
||||||
print(colored("\n[+] Search Results:\n", "green"))
|
print(colored("\n[+] Search Results:\n", "green"))
|
||||||
@@ -1853,6 +1868,7 @@ class PasswordManager:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Failed to search entries: {e}", exc_info=True)
|
logging.error(f"Failed to search entries: {e}", exc_info=True)
|
||||||
print(colored(f"Error: Failed to search entries: {e}", "red"))
|
print(colored(f"Error: Failed to search entries: {e}", "red"))
|
||||||
|
pause()
|
||||||
|
|
||||||
def display_entry_details(self, index: int) -> None:
|
def display_entry_details(self, index: int) -> None:
|
||||||
"""Print detailed information for a single entry."""
|
"""Print detailed information for a single entry."""
|
||||||
|
Reference in New Issue
Block a user