-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroute.py
More file actions
28 lines (23 loc) · 716 Bytes
/
route.py
File metadata and controls
28 lines (23 loc) · 716 Bytes
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
import requests
import json
# import the base url from Constants class
from constants import Constants
class Route:
# Get route wise details
def route_wise(self, direction, route_no):
ROUTE_WISE_URL = Constants.BASE_URL + "/itsroutewise/details"
PARAMS = {'direction': direction, 'routeNO': route_no}
r = requests.post(ROUTE_WISE_URL, data=PARAMS)
if r.status_code is 200:
return r.json()
else:
return
# Route map details
def route_map(self, direction, route_no):
ROUTE_MAP_URL = Constants.BASE_URL + "/routemap/details"
PARAMS = {'direction': direction, 'routeNO': route_no}
r = requests.post(ROUTE_MAP_URL, data=PARAMS)
if r.status_code is 200:
return r.json()
else:
return