Some errors ignored

This commit is contained in:
Profitroll 2022-10-08 12:26:48 +02:00
parent 9c9489aee1
commit d23d9a005d

View File

@ -57,7 +57,7 @@ class Client():
# Look for stops using all possible methods
stop_by_coords client.stop_by_coords(50.131140, 8.733362, radius=300, max_number=3)
stop_by_id = client.stop_by_id("A=1@O=Offenbach (Main)-Zentrum Marktplatz\/Frankf. Straße@X=8764456@Y=50105181@U=80@L=3002510@")
stop_by_id = client.stop_by_id("A=1@O=Offenbach (Main)-Zentrum Marktplatz/Frankf. Straße@X=8764456@Y=50105181@U=80@L=3002510@")
stop_by_name = client.stop_by_name("Groß Karben", max_number=3)
# Find a trip and reconstruct it
@ -110,10 +110,10 @@ class Client():
accessId=self.access_id,
id=id,
extId=id_ext,
direction=direction,
direction=direction, # type: ignore
date=date,
time=time,
duration=duration,
duration=duration, # type: ignore
maxJourneys=journeys_max,
operators=operators,
lines=lines,
@ -166,10 +166,10 @@ class Client():
accessId=self.access_id,
id=id,
extId=id_ext,
direction=direction,
direction=direction, # type: ignore
date=date,
time=time,
duration=duration,
duration=duration, # type: ignore
maxJourneys=journeys_max,
operators=operators,
lines=lines,
@ -182,28 +182,28 @@ class Client():
return BoardDeparture(board_raw, self)
def him_search(self,
date_begin: Union[str, datetime] = None,
date_end: Union[str, datetime] = None,
time_begin: Union[str, datetime] = None,
time_end: Union[str, datetime] = None,
weekdays: Union[str, OrderedDict[str, bool]] = None,
ids: list = None,
operators: list = None,
categories: list = None,
channels: list = None,
companies: list = None,
lines: list = None,
line_ids: list = None,
stations: Union[list, List[Stop]] = None,
station_from: Union[str, Stop] = None,
station_to: Union[str, Stop] = None,
both_ways: bool = None,
train_names: list = None,
search_mode: Literal[SearchMode.MATCH, SearchMode.NOMATCH, SearchMode.TFMATCH] = None,
affected_journey_mode: Literal[AffectedJourneyMode.ALL, AffectedJourneyMode.OFF] = None,
affected_journey_stop_mode: Literal[AffectedJourneyStopMode.ALL, AffectedJourneyStopMode.IMP, AffectedJourneyStopMode.OFF] = None,
priority_min: int = None,
priority_max: int = None
date_begin: Union[str, datetime] = None, # type: ignore
date_end: Union[str, datetime] = None, # type: ignore
time_begin: Union[str, datetime] = None, # type: ignore
time_end: Union[str, datetime] = None, # type: ignore
weekdays: Union[str, OrderedDict[str, bool]] = None, # type: ignore
ids: list = None, # type: ignore
operators: list = None, # type: ignore
categories: list = None, # type: ignore
channels: list = None, # type: ignore
companies: list = None, # type: ignore
lines: list = None, # type: ignore
line_ids: list = None, # type: ignore
stations: Union[list, List[Stop]] = None, # type: ignore
station_from: Union[str, Stop] = None, # type: ignore
station_to: Union[str, Stop] = None, # type: ignore
both_ways: bool = None, # type: ignore
train_names: list = None, # type: ignore
search_mode: Literal[SearchMode.MATCH, SearchMode.NOMATCH, SearchMode.TFMATCH] = None, # type: ignore
affected_journey_mode: Literal[AffectedJourneyMode.ALL, AffectedJourneyMode.OFF] = None, # type: ignore
affected_journey_stop_mode: Literal[AffectedJourneyStopMode.ALL, AffectedJourneyStopMode.IMP, AffectedJourneyStopMode.OFF] = None, # type: ignore
priority_min: int = None, # type: ignore
priority_max: int = None # type: ignore
) -> List[Message]:
"""The him_search method will deliver a list of HIM messages if matched by the given criteria as
well as affected products if any.
@ -239,10 +239,10 @@ class Client():
"""
if isinstance(station_from, Stop):
station_from = station_from.ext_id
station_from = station_from.ext_id # type: ignore
if isinstance(station_to, Stop):
station_to = station_to.ext_id
station_to = station_to.ext_id # type: ignore
if stations != None:
new_stations = []
@ -254,17 +254,17 @@ class Client():
stations = new_stations
if search_mode == None:
search_mode = None
search_mode = None # type: ignore
else:
search_mode = search_mode.code
if affected_journey_mode == None:
affected_journey_mode = None
affected_journey_mode = None # type: ignore
else:
affected_journey_mode = affected_journey_mode.code
if affected_journey_stop_mode == None:
affected_journey_stop_mode = None
affected_journey_stop_mode = None # type: ignore
else:
affected_journey_stop_mode = affected_journey_stop_mode.code
@ -284,13 +284,13 @@ class Client():
lines=lines,
lineids=line_ids,
stations=stations,
fromstation=station_from,
tostation=station_to,
fromstation=station_from, # type: ignore
tostation=station_to, # type: ignore
bothways=both_ways,
trainnames=train_names,
searchmode=search_mode,
affectedJourneyMode=affected_journey_mode,
affectedJourneyStopMode=affected_journey_stop_mode,
searchmode=search_mode, # type: ignore
affectedJourneyMode=affected_journey_mode, # type: ignore
affectedJourneyStopMode=affected_journey_stop_mode, # type: ignore
maxprio=priority_max,
minprio=priority_min
)
@ -332,7 +332,7 @@ class Client():
"""
if real_time_mode == None:
real_time_mode = None
real_time_mode = None # type: ignore
else:
real_time_mode = real_time_mode.code
@ -340,11 +340,11 @@ class Client():
accessId=self.access_id,
id=id,
date=date,
rtMode=real_time_mode,
rtMode=real_time_mode, # type: ignore
fromId=from_id,
fromIdx=from_index,
fromIdx=from_index, # type: ignore
toId=to_id,
toIdx=to_index
toIdx=to_index # type: ignore
)
find_exception(journey_raw)
@ -380,7 +380,7 @@ class Client():
"""
if selection_mode == None:
selection_mode = None
selection_mode = None # type: ignore
else:
selection_mode = selection_mode.code
@ -393,7 +393,7 @@ class Client():
radius=radius,
maxNo=max_number,
stopType=stop_type.code,
locationSelectionMode=selection_mode
locationSelectionMode=selection_mode # type: ignore
)
find_exception(stops_raw)
@ -478,7 +478,7 @@ class Client():
"""
if selection_mode == None:
selection_mode = None
selection_mode = None # type: ignore
else:
selection_mode = selection_mode.code
@ -489,7 +489,7 @@ class Client():
lang=lang.code,
maxNo=max_number,
stopType=stop_type.code,
locationSelectionMode=selection_mode,
locationSelectionMode=selection_mode, # type: ignore
coordLat=coord_lat,
coordLong=coord_lon,
radius=radius,
@ -623,7 +623,7 @@ class Client():
"""
if real_time_mode == None:
real_time_mode = None
real_time_mode = None # type: ignore
else:
real_time_mode = real_time_mode.code
@ -682,7 +682,7 @@ class Client():
showPassingPoints=passing_points,
rtMode=real_time_mode,
rtMode=real_time_mode, # type: ignore
includeEarlier=include_earlier,
withICTAlternatives=ict_alternatives,
@ -699,18 +699,18 @@ class Client():
return trips
def trip_recon(self,
context: Union[str, Journey],
date: Union[str, datetime] = None,
match_real_time: bool = None,
enable_replacements: bool = None,
arrival_dev_lower: int = None,
arrival_dev_upper: int = None,
departure_dev_lower: int = None,
departure_dev_upper: int = None,
passlist: bool = None,
context: Union[str, Trip],
date: Union[str, datetime] = None, # type: ignore
match_real_time: bool = None, # type: ignore
enable_replacements: bool = None, # type: ignore
arrival_dev_lower: int = None, # type: ignore
arrival_dev_upper: int = None, # type: ignore
departure_dev_lower: int = None, # type: ignore
departure_dev_upper: int = None, # type: ignore
passlist: bool = None, # type: ignore
passing_points: bool = False,
real_time_mode: Literal[RealTimeMode.FULL, RealTimeMode.INFOS, RealTimeMode.OFF, RealTimeMode.REALTIME, RealTimeMode.SERVER_DEFAULT] = None,
tariff: bool = None,
real_time_mode: Literal[RealTimeMode.FULL, RealTimeMode.INFOS, RealTimeMode.OFF, RealTimeMode.REALTIME, RealTimeMode.SERVER_DEFAULT] = None, # type: ignore
tariff: bool = None, # type: ignore
messages: bool = False
) -> List[Trip]:
"""Reconstructing a trip can be achieved using the reconstruction context provided by any trip result in the
@ -739,7 +739,7 @@ class Client():
"""
if real_time_mode == None:
real_time_mode = None
real_time_mode = None # type: ignore
else:
real_time_mode = real_time_mode.code
@ -749,7 +749,7 @@ class Client():
trips = []
trips_raw = raw_trip_recon(
accessId=self.access_id,
ctx=context,
ctx=context, # type: ignore
date=date,
matchRtType=match_real_time,
enableReplacements=enable_replacements,
@ -759,7 +759,7 @@ class Client():
depU=departure_dev_upper,
passlist=passlist,
showPassingPoints=passing_points,
rtMode=real_time_mode,
rtMode=real_time_mode, # type: ignore
tariff=tariff,
trafficMessages=messages,
)