mirror of
https://github.com/ClaytonWWilson/Scraper-for-theTVDB.com.git
synced 2025-12-13 00:58:47 +00:00
Fixing imports. Adding requirements.txt
This commit is contained in:
parent
954c90b63c
commit
80a863c8f9
19
actions.py
19
actions.py
@ -187,6 +187,25 @@ def download(imageType, parsed_respObj):
|
||||
quit()
|
||||
return saveNameList
|
||||
|
||||
def installReqs():
|
||||
if is_pip_installed == True:
|
||||
# open Requirements.txt
|
||||
# subprocess.call(["pip", "install", module], stdout=subprocess.DEVNULL,
|
||||
# stdin =subprocess.DEVNULL,
|
||||
# stderr=subprocess.DEVNULL)
|
||||
else:
|
||||
print("You need to install pip.")
|
||||
|
||||
def is_pip_installed():
|
||||
try:
|
||||
subprocess.call(["pip", "--version"], stdout=subprocess.DEVNULL,
|
||||
stdin =subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
except FileNotFoundError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
# The following code is from Red-DiscordBot
|
||||
# https://github.com/Cog-Creators/Red-DiscordBot
|
||||
def is_git_installed():
|
||||
|
||||
11
launcher.py
11
launcher.py
@ -4,15 +4,13 @@ from login import login
|
||||
from actions import wait
|
||||
from actions import clear_screen
|
||||
from actions import clearFolders
|
||||
from actions import installReqs
|
||||
from actions import refreshToken
|
||||
from actions import update
|
||||
from search import search
|
||||
|
||||
# TODO fix naming convention for all variables and functions
|
||||
|
||||
def user_choice():
|
||||
return input("> ").lower().strip()
|
||||
|
||||
while True:
|
||||
clear_screen()
|
||||
print("=============================\n"
|
||||
@ -22,12 +20,11 @@ while True:
|
||||
print("1. Search theTVDB.com")
|
||||
print("2. Clear download folders")
|
||||
print("3. Login/Change login")
|
||||
# print("4. Refresh API Token")
|
||||
print("4. Install Requirements")
|
||||
print("5. Check for updates\n")
|
||||
print("0. Exit\n")
|
||||
|
||||
choice = user_choice()
|
||||
choice = input("> ").lower().strip()
|
||||
|
||||
if choice == "1":
|
||||
search()
|
||||
@ -36,12 +33,12 @@ while True:
|
||||
clear_screen()
|
||||
clearFolders()
|
||||
wait()
|
||||
elif choice == "3": # TODO if already logged in, ask 'are you sure?'
|
||||
elif choice == "3": # TODO add a printout that tells the user who is currently logged in
|
||||
clear_screen()
|
||||
login()
|
||||
wait()
|
||||
elif choice == "4":
|
||||
print("install requirements not implemented yet")
|
||||
installReqs()
|
||||
wait()
|
||||
elif choice == "5":
|
||||
update()
|
||||
|
||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
python-dateutil==2.6.1
|
||||
requests==2.18.4
|
||||
urllib3==1.22
|
||||
Loading…
Reference in New Issue
Block a user