From 1e05c687ce7c53aa61a4539ded0a769553640c43 Mon Sep 17 00:00:00 2001 From: TitanE Date: Thu, 4 Apr 2024 16:17:24 +0300 Subject: [PATCH] keyvault version 1.0.6: - Fixed a bug where the connection object was being used to execute instead of the cursor object --- keyvault.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/keyvault.py b/keyvault.py index 979d5c7..81cf19b 100644 --- a/keyvault.py +++ b/keyvault.py @@ -22,8 +22,8 @@ def database_enc(): for _ in range(3): try: password = gp(prompt = "Enter master password: ") - conn.execute(f"PRAGMA key = {password}") - conn.execute(''' + cursor.execute(f"PRAGMA key = {password}") + cursor.execute(''' CREATE TABLE IF NOT EXISTS data ( id INTEGER PRIMARY KEY AUTOINCREMENT, service TEXT, @@ -56,7 +56,7 @@ def database_enc(): break else: print("Both of the passwords are different. Please enter the same password.") - conn.execute(f"PRAGMA key = {mp}") + cursor.execute(f"PRAGMA key = {mp}") conn.commit() def gen(): @@ -69,14 +69,20 @@ def gen(): print(username) elif userpass == 'p': while True: - length = int(input("Enter password length (above 8 only): ")) + try: + length = int(input("Enter password length (above 8 only): ")) + except ValueError: + length = 16 + print("Password length not specified. Defaulting to 16.") if length <= 7: print("The password is too short. Please enter it again.") else: + pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`~@#$%^&*()-_=+]}[{\"';:.>,,