Classes docstring improved

This commit is contained in:
Profitroll 2022-10-05 12:17:51 +02:00
parent b069b82cc5
commit fe3e839abb
5 changed files with 12 additions and 0 deletions

View File

@ -1,6 +1,7 @@
from isodate import parse_duration
class Gis():
"""Gis object."""
def __init__(self, ref: str, route: dict):

View File

@ -4,6 +4,7 @@ from pyrmv.classes.Stop import StopTrip
from isodate import parse_duration
class Leg():
"""Trip leg object."""
def __init__(self, data: dict):

View File

@ -3,6 +3,7 @@ from datetime import datetime
from isodate import parse_duration
class Url():
"""Traffic message channel url object."""
def __init__(self, data: dict) -> None:
self.name = data["name"]
@ -12,6 +13,7 @@ class Url():
return f"{self.name}: {self.url}"
class Channel():
"""Traffic message channel object."""
def __init__(self, data: dict) -> None:
self.name = data["name"]
@ -29,6 +31,7 @@ class Channel():
class Message():
"""Traffic message object."""
def __init__(self, data: dict) -> None:

View File

@ -2,6 +2,7 @@ from datetime import datetime
class Stop():
"""Stop object."""
def __init__(self, data: dict):
@ -11,6 +12,10 @@ class Stop():
self.ext_id = data["extId"]
else:
self.ext_id = None
if "description" in data:
self.description = data["description"]
else:
self.description = None
self.lon = data["lon"]
self.lat = data["lat"]
@ -18,6 +23,7 @@ class Stop():
return f"Stop {self.name} at {self.lon}, {self.lat}"
class StopTrip(Stop):
"""Trip stop object. It's like a Stop object, but with a date and time."""
def __init__(self, data: dict):

View File

@ -3,6 +3,7 @@ from pyrmv.classes.Stop import StopTrip
from isodate import parse_duration
class Trip():
"""Trip object."""
def __init__(self, data: dict):