From c749cf56c8b600809da72f026adaa012dbb2973a Mon Sep 17 00:00:00 2001 From: adithyagenie Date: Thu, 3 Nov 2022 01:34:30 +0530 Subject: [PATCH] Black --- maze/modules/PlayerBase_func.py | 47 ++++++++++++++++++++++++--------- maze/modules/__init__.py | 3 ++- maze/modules/__main__.py | 2 +- maze/modules/password_forget.py | 4 +-- 4 files changed, 38 insertions(+), 18 deletions(-) diff --git a/maze/modules/PlayerBase_func.py b/maze/modules/PlayerBase_func.py index bf431fc..7ed76f7 100644 --- a/maze/modules/PlayerBase_func.py +++ b/maze/modules/PlayerBase_func.py @@ -592,19 +592,23 @@ def forgotpassword(screen): if input_u not in usernamelist: screen.addstr( - y // 2 - 1, 0, "Username does not exist. Press Enter/Space to continue..." + y // 2 - 1, + 0, + "Username does not exist. Press Enter/Space to continue...", ) while True: key = screen.getch() if key == ord(" ") or key == 10: - screenwipe(screen, sy = y // 2 - 2, sx = x // 2 + 3) + screenwipe(screen, sy=y // 2 - 2, sx=x // 2 + 3) screen.refresh() break else: break - res = get(f"SELECT email FROM player_details\ - WHERE username = '{input_u}'") + res = get( + f"SELECT email FROM player_details\ + WHERE username = '{input_u}'" + ) email = res[0][0] otp = sender(input_u, email) screen.addstr(y // 2 + 1, 0, "Enter OTP recieved in registered mail address:") @@ -624,20 +628,32 @@ def forgotpassword(screen): screen.refresh() screen.addstr(1, x // 2 - 7, "FORGOT PASSWORD") while True: - enter_pass = password(screen, y // 2 - 2, x // 2 - 7, optionaltxt="Enter new password: ") - confirm_pass = password(screen, y // 2 + 1, x // 2 - 7, optionaltxt="Confirm password: ") + enter_pass = password( + screen, y // 2 - 2, x // 2 - 7, optionaltxt="Enter new password: " + ) + confirm_pass = password( + screen, y // 2 + 1, x // 2 - 7, optionaltxt="Confirm password: " + ) if enter_pass == confirm_pass: break else: - screen.addstr(y // 2 + 3, 0, "Passwords do not match. Press Enter to try again.") + screen.addstr( + y // 2 + 3, + 0, + "Passwords do not match. Press Enter to try again.", + ) while True: key = screen.getch() if key == 10: - screenwipe(screen, sy= y // 2 - 2, sx = x // 2 - 7) + screenwipe(screen, sy=y // 2 - 2, sx=x // 2 - 7) break else: if tries < 10: - screen.addstr(y // 2 + 3, 0, "Entered OTP is wrong. Press esc to exit or Enter to try again.") + screen.addstr( + y // 2 + 3, + 0, + "Entered OTP is wrong. Press esc to exit or Enter to try again.", + ) while True: key = screen.getch() if key == 10: @@ -653,7 +669,11 @@ def forgotpassword(screen): continue else: - screen.addstr(y // 2 + 3, 0, "Entered OTP is wrong. Maximum tries exceeded. Returning to account menu...") + screen.addstr( + y // 2 + 3, + 0, + "Entered OTP is wrong. Maximum tries exceeded. Returning to account menu...", + ) sleep(5) screen.clear() screen.refresh() @@ -661,9 +681,11 @@ def forgotpassword(screen): return break - post(f"UPDATE player_details\ + post( + f"UPDATE player_details\ SET password = '{enter_pass}'\ - WHERE username = '{input_u}'") + WHERE username = '{input_u}'" + ) screen.addstr(y // 2 + 3, x // 2 - 10, "Password has been changed successfully.") screen.addstr(y // 2 + 4, x // 2 - 8, "Returning to account menu...") sleep(3) @@ -671,7 +693,6 @@ def forgotpassword(screen): return - def leaderboard(screen): y, x = screen.getmaxyx() screen.clear() diff --git a/maze/modules/__init__.py b/maze/modules/__init__.py index 3f856e8..483d4f7 100644 --- a/maze/modules/__init__.py +++ b/maze/modules/__init__.py @@ -1,5 +1,6 @@ from maze.modules.maze import main import curses + def bruh(): - curses.wrapper(main) \ No newline at end of file + curses.wrapper(main) diff --git a/maze/modules/__main__.py b/maze/modules/__main__.py index 925d9b2..3724b49 100644 --- a/maze/modules/__main__.py +++ b/maze/modules/__main__.py @@ -1 +1 @@ -#bruh \ No newline at end of file +# bruh diff --git a/maze/modules/password_forget.py b/maze/modules/password_forget.py index 3214c97..b27620a 100644 --- a/maze/modules/password_forget.py +++ b/maze/modules/password_forget.py @@ -35,9 +35,7 @@ The Labyrinth Team""" message = MIMEMultipart() message["From"] = sender_address message["To"] = receiver_address - message[ - "Subject" - ] = "Reset your Labyrinth account password" + message["Subject"] = "Reset your Labyrinth account password" message.attach(MIMEText(mail_content, "html")) # Create SMTP session for sending the mail