/
Main.py
39 lines (37 loc) · 1.48 KB
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import urllib
from Command import Command
from Help import Help
from GlobalVariables import goodReadsUrl, listOfCommands
from Add import Add
from List import List
def mainControlFlow():
while True:
temp = None
currCommand = []
for i in input("Please input a command: \n").split():
currCommand.append(i)
if currCommand[0] == 'help':
temp = Help(currCommand[0])
temp.execute()
elif currCommand[0] == 'add':
if currCommand[1] == 'toRead':
temp = Add(currCommand[0])
temp.execute(currCommand[1], currCommand[2])
elif currCommand[1] == 'currentlyReading':
temp = Add(currCommand[0])
temp.execute(currCommand[1], currCommand[2])
else:
print("Command not recognized, please type help for more information.")
elif currCommand[0] == 'list':
if currCommand[1] == 'genre':
temp = List(currCommand[0] + currCommand[1])
temp.execute(currCommand[2])
elif currCommand[1] == 'toRead':
temp = List(currCommand[0] + currCommand[1])
temp.execute(currCommand[1])
elif currCommand[1] == 'currentlyReading':
temp = List(currCommand[0] + currCommand[1])
temp.execute(currCommand[1])
else:
print("Command not recognized, please type help for more information.")
mainControlFlow()