diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0533757 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +key.key \ No newline at end of file diff --git a/main.py b/main.py index dcee277..567f818 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,28 @@ -from cryptography.fernet import Fernet -import customtkinter as ctk + + import json import os import pyperclip +import subprocess +import sys + +try: + import customtkinter as ctk +except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", "customtkinter"]) + import customtkinter as ctk + +try: + from cryptography.fernet import Fernet +except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", "cryptography"]) + from cryptography.fernet import Fernet + +try: + import pyperclip +except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", "pyperclip"]) + import pyperclip ctk.set_appearance_mode("Dark") app = ctk.CTk() @@ -64,8 +84,8 @@ def saveToJson(): data = json.load(file) except (FileNotFoundError, json.JSONDecodeError): data = {} - - data[WebsiteIn] = encrypted.decode() + + data[WebsiteIn] = encrypted.decode() with open("passwords.json", "w") as file: diff --git a/passwords.json b/passwords.json index 7a73a41..49d1a20 100644 --- a/passwords.json +++ b/passwords.json @@ -1,2 +1,3 @@ { -} \ No newline at end of file + +}