-
Notifications
You must be signed in to change notification settings - Fork 0
/
old_code.py
29 lines (26 loc) · 953 Bytes
/
old_code.py
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
import database
from auth import Account
db = database.Database()
db.clean()
db = database.Database()
db.addUser(Account("email@email", "password", "name", "picture"))
db.login(Account("email@email", "password"))
while True:
action = input("(R)egister or (L)ogin:\n")
if action.strip().lower() == 'r':
acc = Account(input("Enter email: ").strip().lower(),
input("Enter password: ").strip().lower(),
input("Enter username: ").strip().lower(),
input("Upload Photo: ").strip().lower())
try:
db.addUser(acc)
except database.AccountError as e:
print(e)
elif action.strip().lower() == 'l':
acc = Account(input("Enter email: ").strip().lower(),
input("Enter password: ").strip().lower())
try:
db.login(acc)
print(acc.username)
except database.AccountNotFound as e:
print(e)