Added CTRL+C option to cancel login

This commit is contained in:
ClaytonWWilson 2018-07-13 09:24:24 -04:00
parent d31e4d563e
commit 954c90b63c
2 changed files with 14 additions and 13 deletions

View File

@ -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()

View File

@ -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,