-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
57 lines (42 loc) · 1.4 KB
/
Copy pathmain.py
File metadata and controls
57 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import sqlite3
from os import environ as env
from customtkinter import CTk
from assets.code.ui import Colors
from src.auth.login import Login
class App(CTk):
def __init__(self) -> None:
super().__init__(fg_color=Colors.White)
self.title("Security")
self.resizable(False, False)
env["DB"] = "main.db"
conn = sqlite3.connect(env["DB"])
curr = conn.cursor()
curr.execute(
"""CREATE TABLE if not exists Users (
"userId" INTEGER NOT NULL UNIQUE,
"username" TEXT NOT NULL,
"password" TEXT NOT NULL,
PRIMARY KEY("userId" AUTOINCREMENT)
);"""
)
curr.execute(
"""CREATE TABLE if not exists Authentifiants (
"authId" INTEGER NOT NULL UNIQUE,
"parentId" INTEGER,
"title" TEXT,
"domain" TEXT,
"username" TEXT,
"email" TEXT,
"password" TEXT,
"category" TEXT,
"note" TEXT,
FOREIGN KEY("parentId") REFERENCES "Users"("userId"),
PRIMARY KEY("authId" AUTOINCREMENT)
)"""
)
conn.commit()
conn.close()
Login(self)
if __name__ == "__main__":
app = App()
app.mainloop()