Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page

Commit 35c902d3 authored by Phyks's avatar Phyks

Merge branch 'split-different-stations' into 'master'

Split stations on comma

See merge request !32
parents 82f2e842 7a9767ff
Pipeline #79787 failed with stage
in 4 minutes and 55 seconds
......@@ -289,12 +289,24 @@ def guess_stations(flats_list, constraint, config):
matched_stations = fuzzy_match(
[ for x in opendata["stations"]],
# Weboob modules can return several stations in a comma-separated list.
flat_stations = flat_station.split(',')
# But some stations containing a comma exist, so let's add the initial
# value to the list of stations to check if there was one.
if len(flat_stations) > 1:
matched_stations = []
for tentative_station in flat_stations:
matched_stations += fuzzy_match(
[ for x in opendata["stations"]],
# Keep only one occurrence of each station
matched_stations = list(set(matched_stations))
# Filter out the stations that are obviously too far and not well
# guessed
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment