-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.py
More file actions
51 lines (40 loc) · 1.35 KB
/
controller.py
File metadata and controls
51 lines (40 loc) · 1.35 KB
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
# imports model and view
import model as m
import view as v
# creates a new class
class Controller():
# initializes the model and view
def __init__(self):
self.x = m.MapQuest()
self.y = v.Main_GUI()
# links the model and view to check if url is correct
def return_dist(self, h):
dis = self.x.checking_url(h)
return dis
# links the model and view to return distance
def return_distance(self, a):
dista = self.x.totalDistance(a)
return dista
# links the model and view to retun time
def return_time(self, b):
timing = self.x.totalTime(b)
return timing
# links the model and view to return directions
def return_direction(self, d):
direct = self.x.directions(d)
return direct
# links the model and view to return latitude and logitude
def return_LatandLong(self, g):
L,P = self.x.LatandLong(g)
return L,P
# links the model and view to your choices for your interest
def return_POI(self, q, keyw, rest):
my_POI = self.x.pointOfInterest(q, keyw, rest)
return my_POI
# main method to run the GUI file
def main_screen(self):
self.y.run()
# main functionality of the code
if __name__ == '__main__':
u = Controller()
u.main_screen()