find_exception is only used in normal methods now
This commit is contained in:
@@ -3,7 +3,6 @@ from typing import Dict, OrderedDict, Union
|
||||
from xmltodict import parse as xmlparse
|
||||
from datetime import datetime
|
||||
|
||||
from pyrmv.utility.find_exception import find_exception
|
||||
from pyrmv.utility.weekdays_bitmask import weekdays_bitmask
|
||||
|
||||
try:
|
||||
@@ -124,7 +123,9 @@ def him_search(accessId: str,
|
||||
|
||||
output = get("https://www.rmv.de/hapi/himsearch", params=payload, headers=headers)
|
||||
|
||||
find_exception(output.json())
|
||||
# Exceptions checker moved to normal methods
|
||||
# and exceptions will no longer raise in raw ones.
|
||||
# find_exception(output.json())
|
||||
|
||||
if json:
|
||||
return output.json()
|
||||
|
@@ -2,8 +2,6 @@ from requests import get
|
||||
from typing import List, Union
|
||||
from xmltodict import parse as xmlparse
|
||||
|
||||
from pyrmv.utility.find_exception import find_exception
|
||||
|
||||
try:
|
||||
from typing import Literal
|
||||
except ImportError:
|
||||
@@ -28,7 +26,9 @@ def journey_detail(accessId: str,
|
||||
|
||||
output = get("https://www.rmv.de/hapi/journeyDetail", params=payload, headers=headers)
|
||||
|
||||
find_exception(output.json())
|
||||
# Exceptions checker moved to normal methods
|
||||
# and exceptions will no longer raise in raw ones.
|
||||
# find_exception(output.json())
|
||||
|
||||
if json:
|
||||
return output.json()
|
||||
|
@@ -1,9 +1,6 @@
|
||||
from requests import get
|
||||
from typing import List, Union
|
||||
from xmltodict import parse as xmlparse
|
||||
from pyrmv.classes.Stop import Stop
|
||||
|
||||
from pyrmv.utility.find_exception import find_exception
|
||||
|
||||
try:
|
||||
from typing import Literal
|
||||
@@ -63,7 +60,9 @@ def stop_by_coords(accessId: str,
|
||||
|
||||
output = get("https://www.rmv.de/hapi/location.nearbystops", params=payload, headers=headers)
|
||||
|
||||
find_exception(output.json())
|
||||
# Exceptions checker moved to normal methods
|
||||
# and exceptions will no longer raise in raw ones.
|
||||
# find_exception(output.json())
|
||||
|
||||
if json:
|
||||
return output.json()
|
||||
|
@@ -1,9 +1,6 @@
|
||||
from requests import get
|
||||
from typing import List, Union
|
||||
from xmltodict import parse as xmlparse
|
||||
from pyrmv.classes.Stop import Stop
|
||||
|
||||
from pyrmv.utility.find_exception import find_exception
|
||||
|
||||
try:
|
||||
from typing import Literal
|
||||
@@ -77,7 +74,9 @@ def stop_by_name(accessId: str,
|
||||
|
||||
output = get("https://www.rmv.de/hapi/location.name", params=payload, headers=headers)
|
||||
|
||||
find_exception(output.json())
|
||||
# Exceptions checker moved to normal methods
|
||||
# and exceptions will no longer raise in raw ones.
|
||||
# find_exception(output.json())
|
||||
|
||||
if json:
|
||||
return output.json()
|
||||
|
@@ -134,7 +134,7 @@ def trip_find(accessId: str,
|
||||
### Args:
|
||||
* accessId (str): Access ID for identifying the requesting client. Get your key on [RMV website](https://opendata.rmv.de/site/start.html).
|
||||
* lang (Literal["de","da","en","es","fr","hu","it","nl","no","pl","sv","tr"], optional): The language of response. Defaults to "en".
|
||||
* json (bool, optional): Whether response should be retrieved as JSON. XML is returned if False. Only matters if raw_response is True. Defaults to True.
|
||||
* json (bool, optional): Whether response should be retrieved as JSON. XML is returned if False. Defaults to True.
|
||||
* originId (str, optional): Specifies the station/stop ID of the origin for the trip. Such ID can be retrieved from stopByName() or stopByCoords(). Defaults to None.
|
||||
* originExtId (str, optional): Deprecated. Please use originId as it supports external IDs. Specifies the external station/stop ID of the origin for the trip. Such ID can be retrieved from stopByName() or stopByCoords(). Defaults to None.
|
||||
* originCoordLat (Union[str, float], optional): Latitude of station/stop coordinate of the trip's origin. The coordinate can be retrieved from stopByName() or stopByCoords(). Defaults to None.
|
||||
@@ -242,13 +242,15 @@ def trip_find(accessId: str,
|
||||
payload[str(var)] = val.strftime("%H:%M")
|
||||
else:
|
||||
payload[str(var)] = val
|
||||
elif str(var) not in ["json", "headers", "payload", "raw_response"]:
|
||||
elif str(var) not in ["json", "headers", "payload"]:
|
||||
if val != None:
|
||||
payload[str(var)] = val
|
||||
|
||||
output = get("https://www.rmv.de/hapi/trip", params=payload, headers=headers)
|
||||
|
||||
find_exception(output.json())
|
||||
# Exceptions checker moved to normal methods
|
||||
# and exceptions will no longer raise in raw ones.
|
||||
# find_exception(output.json())
|
||||
|
||||
if json:
|
||||
return output.json()
|
||||
|
@@ -28,7 +28,9 @@ def trip_recon(accessId: str,
|
||||
|
||||
output = get("https://www.rmv.de/hapi/recon", params=payload, headers=headers)
|
||||
|
||||
find_exception(output.json())
|
||||
# Exceptions checker moved to normal methods
|
||||
# and exceptions will no longer raise in raw ones.
|
||||
# find_exception(output.json())
|
||||
|
||||
if json:
|
||||
return output.json()
|
||||
|
Reference in New Issue
Block a user