-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
77 lines (71 loc) · 2.83 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#import places as places
import PlacesAPI as placesApi
import userpref as userpref
if __name__ == "__main__":
#Get user input
user = userpref.User({"Chinese":4,"Korean": 4, "Quiet": 3, "Mediterranean": 1},{"Fine arts":3,"Theatre":2},{"Movie":8,"KTV":2},{"Althetic":3,"Formal":2})
i = 0
listCategory = {"Restaurant":0,"Arts & Culture":0,"Entertainment":0,"Shopping":0}
while i == 0:
print("Select preferences:\n0: Restaurant\n1: Arts & Culture\n2: Entertainment\n3: Shopping\n")
userInput = int(input())
if (userInput == 0):
listCategory["Restaurant"] = 1
if (userInput == 1):
listCategory["Arts & Culture"] = 1
if (userInput == 2):
listCategory["Entertainment"] = 1
if (userInput == 3):
listCategory["Shopping"] = 1
print("Do you want to add additional categories\n0:No\n1:Yes")
print(listCategory)
userInput = int(input())
if (userInput == 0):
i = 1
inpute = ""
places = []
for c in listCategory.keys():
if listCategory.get(c) == 1:
if c == "Restaurant":
for f in user.food:
result = placesApi.pull_data(f, "43.662127, -79.387779")
if result is not None:
places.append(result)
break
elif c == "Arts & Culture":
for f in user.arts:
result = placesApi.pull_data(f, "43.662127, -79.387779")
if result is not None:
places.append(result)
break
elif c == "Entertainment":
for f in user.entertainment:
result = placesApi.pull_data(f, "43.662127, -79.387779")
if result is not None:
places.append(result)
break
elif c == "Shopping":
for f in user.shopping:
result = placesApi.pull_data(f, "43.662127, -79.387779")
if result is not None:
places.append(result)
break
# print(inpute)
# places = placesApi.pull_data(inpute, "43.662127, -79.387779")
# print(places)
for i in range(len(places)):
print("{0}: {1}".format(i, places[i]))
input_text = input("Would you like to remove any of these items?")
try:
places.pop(int(input_text), None)
except:
print("Please input a number")
if input_text == "":
break
if len(places) != 0:
print(placesApi.find_route([place['place_id'] for place in places.values()]))
print("Done")
#Call api functions
#coordinates = "2.230225,48.817716"
#x = places.findPlaces(coordinates)
#printall(x)