From c28263970e0ffcbc65526ffb7171b4911faa5c45 Mon Sep 17 00:00:00 2001 From: agsNeto20 <37492761+agsNeto20@users.noreply.github.com> Date: Fri, 27 Nov 2020 11:09:32 +0000 Subject: [PATCH] Update app.py --- app.py | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/app.py b/app.py index 93d0bc2..6ba5c86 100644 --- a/app.py +++ b/app.py @@ -1,31 +1,55 @@ import database -MENU = """-- Netflox -- - -1) Sign Up. -2) Log in. -0) Exit. - -Your Selection: """ - def menu(): - conn = database.conn() - while (user_input := input(MENU)) != "0": - print(user_input) - if user_input == "1": # if + menu_interface = """-- Netflox -- + 1) Sign Up. + 2) Log in. + 0) Exit. + Your Selection: """ + + while (user_input := input(menu_interface)) != "0": + if user_input == "1": + print("Sign up") name = input("Enter your name: ") email = input("Enter your e-mail: ") password = input("Enter your password: ") - - database.create_user(conn, name, email, password) + database.create_user(name, email, password) elif user_input == "2": + print("Log in") email = input("Enter your e-mail: ") password = input("Enter your password: ") + if database.log_in(email, password): + break + else: print("Invalid input, please try again") +def client(): + + client_interface = """Welcome + 1) Search products. + 2) My history. + 3) Messages. + 0) Exit + Your Selection: """ + + while (user_input := input(client_interface)) != "0": + if user_input == "1": + + search_interface = """Order by + 1) Name + 2) Actor + 3) Director + 4) Date + 5) + 6) + 7) + Your Selection: """ + + menu() +client()