diff --git a/launcher.py b/launcher.py index b66af58..812ff84 100644 --- a/launcher.py +++ b/launcher.py @@ -37,14 +37,9 @@ while True: clearFolders() wait() elif choice == "3": # TODO if already logged in, ask 'are you sure?' - clear_screen() # TODO wait to clear login and add a ctrl+c option to cancel - # clearLogin() + clear_screen() login() wait() - # elif choice == "4": # TODO need to perform this option automatically - # clear_screen() - # refreshToken() - # wait() elif choice == "4": print("install requirements not implemented yet") wait() diff --git a/login.py b/login.py index 3b14388..7ccafec 100644 --- a/login.py +++ b/login.py @@ -27,14 +27,20 @@ def login(): tmp_user_key = "" tmp_user_name = "" - print("You can find your user key & request an API key while logged in at:\nhttps://www.thetvdb.com/?tab=userinfo\n") + print("You can find your user key & request an API key while logged in at:\n" + "https://www.thetvdb.com/?tab=userinfo\n" + "Press CTRL+C to cancel.\n") - while tmp_api_key is "": - tmp_api_key = input("Enter your api key: ") - while tmp_user_key is "": - tmp_user_key = input("Enter your user key: ") - while tmp_user_name is "": - tmp_user_name = input("Enter your username: ") + try: + while tmp_api_key is "": + tmp_api_key = input("Enter your api key: ") + while tmp_user_key is "": + tmp_user_key = input("Enter your user key: ") + while tmp_user_name is "": + tmp_user_name = input("Enter your username: ") + except KeyboardInterrupt as e: + print("\n") + return LOGIN_DATA = { "apikey": tmp_api_key,