Hi,
when putting a unknown stop_name you get an error:
dan@jf26-x:~/scripts/stibXml2json$ python3 example.py
Traceback (most recent call last):
File "example.py", line 35, in <module>
LOOP.run_until_complete(go(LOOP))
File "/usr/lib/python3.6/asyncio/base_events.py", line 488, in run_until_complete
return future.result()
File "example.py", line 19, in go
print(await service.get_passages(stop_name, lang_message="en", max_passages=1))
File "/home/dan/.local/lib/python3.6/site-packages/pystibmivb/service/STIBService.py", line 35, in get_passages
stop_infos) + " Provided line filter:" + str(line_filters))
File "/home/dan/.local/lib/python3.6/site-packages/pystibmivb/domain/stop.py", line 82, in __str__
return f"{self.stop_name}({self.get_location()}): {[str(k) for k in self.lines]}: {[str(v) for v in self.line_infos.values()]}"
File "/home/dan/.local/lib/python3.6/site-packages/pystibmivb/domain/stop.py", line 95, in get_location
return {"lat": sum(latitudes)/len(latitudes), "lon": sum(longitudes)/len(longitudes)}
ZeroDivisionError: division by zero
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f9c419a46a0>
Hi, when putting a unknown stop_name you get an error: