From 428442d1cb15992c89584e4d88d4d6e6a16265ae Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Sat, 24 Sep 2022 12:08:43 +0200 Subject: [PATCH] get_id() method removed --- pyrmv/classes/Stop.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pyrmv/classes/Stop.py b/pyrmv/classes/Stop.py index 19f472d..5301bc5 100644 --- a/pyrmv/classes/Stop.py +++ b/pyrmv/classes/Stop.py @@ -4,6 +4,7 @@ from datetime import datetime class Stop(): def __init__(self, data: dict): + self.name = data["name"] self.id = data["id"] if "extId" in data: @@ -13,29 +14,17 @@ class Stop(): self.lon = data["lon"] self.lat = data["lat"] - def get_id(self) -> str: - if self.id != None: - return self.id - elif self.ext_id != None: - return self.ext_id - elif self.name != None: - return self.name - else: - return f"{self.lon}, {self.lat}" - def __str__(self) -> str: return f"Stop {self.name} at {self.lon}, {self.lat}" class StopTrip(Stop): def __init__(self, data: dict): + self.type = data["type"] self.date = datetime.strptime(data["date"], "%Y-%m-%d") self.time = datetime.strptime(data["time"], "%H:%M:%S") super().__init__(data) - def get_id(self) -> str: - return super().get_id() - def __str__(self) -> str: return f"Stop {self.name} at {self.lon}, {self.lat} at {self.time.time()} {self.date.date()}" \ No newline at end of file