Fixed some imports

This commit is contained in:
Clayton Wilson 2017-11-06 08:19:52 -05:00
parent 64239e36ab
commit da958cce55
3 changed files with 16 additions and 19 deletions

View File

@ -8,6 +8,9 @@ import subprocess
from checks import checkTimestamp from checks import checkTimestamp
from checks import getToken from checks import getToken
def wait():
input("Press enter to continue.")
def clear_screen(): def clear_screen():
IS_WINDOWS = os.name == "nt" IS_WINDOWS = os.name == "nt"
if IS_WINDOWS: if IS_WINDOWS:

View File

@ -6,10 +6,6 @@ from search import search
def user_choice(): def user_choice():
return input("> ").lower().strip() return input("> ").lower().strip()
def wait():
input("Press enter to continue.")
while True: while True:
clear_screen() clear_screen()
print("=============================\n" print("=============================\n"

View File

@ -2,9 +2,9 @@ import requests
import json import json
import urllib.parse import urllib.parse
import os.path import os.path
from launcher import wait from actions import wait
# import login
def searchRemainder(imageType, saveNameList, idNum):#Finds any images missing from the api call in getImages def searchRemainder(imageType, saveNameList, idNum):#Finds any images missing from the api call in getImages
numbers = [] numbers = []
@ -73,7 +73,7 @@ def search():
if checkTimestamp(saveTime, curTime) == False: if checkTimestamp(saveTime, curTime) == False:
print("Your token has expired. Get a new one by choosing Refresh Token.") print("Your token has expired. Get a new one by choosing Refresh Token.")
return None return None
else: # All login checks pass and search starts else: # All login checks pass and search starts # TODO move everything below out of the try except
FAN_KEY_TYPE = "?keyType=fanart" # These are used in the search strings FAN_KEY_TYPE = "?keyType=fanart" # These are used in the search strings
POS_KEY_TYPE = "?keyType=poster" POS_KEY_TYPE = "?keyType=poster"
BAN_KEY_TYPE = "?keyType=series" BAN_KEY_TYPE = "?keyType=series"
@ -131,13 +131,11 @@ def search():
fanart = searchImages(idNum, FAN_KEY_TYPE, authHeaders) # for banners, fanart, and posters fanart = searchImages(idNum, FAN_KEY_TYPE, authHeaders) # for banners, fanart, and posters
poster = searchImages(idNum, POS_KEY_TYPE, authHeaders) poster = searchImages(idNum, POS_KEY_TYPE, authHeaders)
banner = searchImages(idNum, BAN_KEY_TYPE, authHeaders) banner = searchImages(idNum, BAN_KEY_TYPE, authHeaders)
downloadImages("fanart", fanart, idNum) # TODO find a better way to pass these variables. Constructor?
downloadImages("poster", poster, idNum)
downloadImages("banner", banner, idNum)
return None
except: except:
print("There was an error checking your login. Try logging in again with 'Login/Change login'.") print("There was an error checking your login. Try logging in again with 'Login/Change login'.")
break return None
downloadImages("fanart", fanart, idNum) # TODO find a better way to pass this variable
downloadImages("poster", poster, idNum)
downloadImages("banner", banner, idNum)