Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Commit 107d372

Browse files
authored
Merge pull request #8 from paul0x1C/master
add change_limit option in get_routes
2 parents 719077e + b3fea34 commit 107d372

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mvg_api/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def get_stations(station):
164164

165165
def get_route(start, dest,
166166
time=None, arrival_time=False,
167-
max_walk_time_to_start=None, max_walk_time_to_dest=None):
167+
max_walk_time_to_start=None, max_walk_time_to_dest=None,
168+
change_limit=None):
168169
"""Plans a route from start to dest
169170
170171
Parameters
@@ -214,6 +215,10 @@ def get_route(start, dest,
214215
options.append("maxTravelTimeFootwayToDestination=" +
215216
str(max_walk_time_to_dest))
216217

218+
if change_limit is not None: # 'if change_limit:' would not work for 0
219+
if isinstance(change_limit, int):
220+
options.append("changeLimit=" + str(change_limit))
221+
217222
options_url = "&".join(options)
218223
url = routing_url + options_url
219224
results = _perform_api_request(url)

0 commit comments

Comments
 (0)