-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathtest.py
33 lines (27 loc) · 1.28 KB
/
test.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
# import run, LaundryScrape, shuttle
from services import *
f = open('output.txt', 'w')
option = 2
if (option == 1):
for room, roomid in LaundryScrape.rooms.iteritems():
lst = room.split(" ")
lst.extend(["LAUNDRY", "WASHERS", "WASHER"])
s1 = str(lst)
f.write("{'service': 'L', 'roomid':'" + roomid +"', 'machinetype':'washer', 'label': '" + room + " Washers', 'tags': " + s1 +"},\n")
lst = room.split(" ")
lst.extend(["LAUNDRY", "DRYER", "DRYERS"])
s2 = str(lst)
f.write("{'service': 'L', 'roomid':'" + roomid +"', 'machinetype':'dryer', 'label': '" + room + " Dryers', 'tags': " + s2 +"},\n")
elif (option == 2):
for stop in shuttle.stops:
lst = stop['name'].upper().split(" ")
lst.extend(["SHUTTLE", "STOP"])
f.write("{'service': 'S-S', 'stopid': '" + stop['stop_id'] + "' , 'label': '"+ stop['name'] +" Shuttle Stop', 'tags':"+ str(lst) +"},\n")
elif (option == 3):
for route in shuttle.routes:
lst = route['name'].upper().split(" ")
lst.extend(["SHUTTLE", "ROUTE"])
f.write("{'service': 'S-R', 'routeid': '" + route['route_id'] + "' , 'label': '"+ route['name'] +" Shuttle Route', 'tags':"+ str(lst) +"},\n")
elif (option == 4):
shuttle.arrivalsStopToString(shuttle.arrivalsAtStopID('4070614'))
shuttle.arrivalsRouteToString(shuttle.arrivalsAtRouteId('4003894'))