Skip to content

Commit

Permalink
Fixed issue#30 : Display password file size in menu
Browse files Browse the repository at this point in the history
Updated main.py by including a new feature in the menu i.e Displaying the password file size when loaded.
  • Loading branch information
stutijain2006 authored Dec 16, 2024
1 parent 075360e commit 6220200
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from manager import PasswordManager
import os


def main():
Expand All @@ -17,6 +18,7 @@ def main():
4. Load an existing password file
5. Add a password
6. Get a password
7. Display password file size
q. Quit
""")

Expand All @@ -42,6 +44,15 @@ def main():
elif choice == '6':
site = input("Enter site: ").strip()
print(f"Password for {site}: {pm.get_password(site)}")
elif choice == '7':
if pm.password_file:
try:
file_size=os.path.getsize(pm.password_file)
print("Password file size:", file_size,"bytes")
except FileNotFoundError:
print("Password file not found.")
else:
print("No password file loaded.")
elif choice == 'q':
done = True
print("Goodbye!")
Expand Down

0 comments on commit 6220200

Please sign in to comment.