Removed unused imports and fixed real_time_mode

This commit is contained in:
Profitroll 2022-10-06 13:04:27 +02:00
parent 23527c85f3
commit a5022011ed

View File

@ -1,7 +1,6 @@
from datetime import datetime from datetime import datetime
from typing import Union from typing import Union
from pyrmv.classes.Journey import Journey from pyrmv.classes.Journey import Journey
from pyrmv.errors.not_ready import NotReadyYetError
from pyrmv.enums.rt_mode import RealTimeMode from pyrmv.enums.rt_mode import RealTimeMode
from pyrmv.raw.journey_detail import journey_detail as raw_journey_detail from pyrmv.raw.journey_detail import journey_detail as raw_journey_detail
from pyrmv.utility.find_exception import find_exception from pyrmv.utility.find_exception import find_exception
@ -23,7 +22,7 @@ def journey_detail(
to_index: int = None # type: ignore to_index: int = None # type: ignore
) -> Journey: ) -> Journey:
"""The journey_detail method will deliver information about the complete route of a vehicle. The journey """The journey_detail method will deliver information about the complete route of a vehicle. The journey
identifier is part of a trip or `board_departure` response. It contains a list of all stops/stations of this journey identifier is part of a trip or `board_departure()` response. It contains a list of all stops/stations of this journey
including all departure and arrival times (with real-time data if available) and additional information like including all departure and arrival times (with real-time data if available) and additional information like
specific attributes about facilities and other texts. specific attributes about facilities and other texts.
@ -43,11 +42,16 @@ def journey_detail(
* Journey: Instance of Journey object. * Journey: Instance of Journey object.
""" """
if real_time_mode == None:
real_time_mode = None
else:
real_time_mode = real_time_mode.code
journey_raw = raw_journey_detail( journey_raw = raw_journey_detail(
accessId=access_id, accessId=access_id,
id=id, id=id,
date=date, date=date,
rtMode=real_time_mode.code, rtMode=real_time_mode,
fromId=from_id, fromId=from_id,
fromIdx=from_index, fromIdx=from_index,
toId=to_id, toId=to_id,