Classes docstring improved
This commit is contained in:
parent
b069b82cc5
commit
fe3e839abb
@ -1,6 +1,7 @@
|
|||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
class Gis():
|
class Gis():
|
||||||
|
"""Gis object."""
|
||||||
|
|
||||||
def __init__(self, ref: str, route: dict):
|
def __init__(self, ref: str, route: dict):
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ from pyrmv.classes.Stop import StopTrip
|
|||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
class Leg():
|
class Leg():
|
||||||
|
"""Trip leg object."""
|
||||||
|
|
||||||
def __init__(self, data: dict):
|
def __init__(self, data: dict):
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ from datetime import datetime
|
|||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
class Url():
|
class Url():
|
||||||
|
"""Traffic message channel url object."""
|
||||||
|
|
||||||
def __init__(self, data: dict) -> None:
|
def __init__(self, data: dict) -> None:
|
||||||
self.name = data["name"]
|
self.name = data["name"]
|
||||||
@ -12,6 +13,7 @@ class Url():
|
|||||||
return f"{self.name}: {self.url}"
|
return f"{self.name}: {self.url}"
|
||||||
|
|
||||||
class Channel():
|
class Channel():
|
||||||
|
"""Traffic message channel object."""
|
||||||
|
|
||||||
def __init__(self, data: dict) -> None:
|
def __init__(self, data: dict) -> None:
|
||||||
self.name = data["name"]
|
self.name = data["name"]
|
||||||
@ -29,6 +31,7 @@ class Channel():
|
|||||||
|
|
||||||
|
|
||||||
class Message():
|
class Message():
|
||||||
|
"""Traffic message object."""
|
||||||
|
|
||||||
def __init__(self, data: dict) -> None:
|
def __init__(self, data: dict) -> None:
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
|
|
||||||
class Stop():
|
class Stop():
|
||||||
|
"""Stop object."""
|
||||||
|
|
||||||
def __init__(self, data: dict):
|
def __init__(self, data: dict):
|
||||||
|
|
||||||
@ -11,6 +12,10 @@ class Stop():
|
|||||||
self.ext_id = data["extId"]
|
self.ext_id = data["extId"]
|
||||||
else:
|
else:
|
||||||
self.ext_id = None
|
self.ext_id = None
|
||||||
|
if "description" in data:
|
||||||
|
self.description = data["description"]
|
||||||
|
else:
|
||||||
|
self.description = None
|
||||||
self.lon = data["lon"]
|
self.lon = data["lon"]
|
||||||
self.lat = data["lat"]
|
self.lat = data["lat"]
|
||||||
|
|
||||||
@ -18,6 +23,7 @@ class Stop():
|
|||||||
return f"Stop {self.name} at {self.lon}, {self.lat}"
|
return f"Stop {self.name} at {self.lon}, {self.lat}"
|
||||||
|
|
||||||
class StopTrip(Stop):
|
class StopTrip(Stop):
|
||||||
|
"""Trip stop object. It's like a Stop object, but with a date and time."""
|
||||||
|
|
||||||
def __init__(self, data: dict):
|
def __init__(self, data: dict):
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ from pyrmv.classes.Stop import StopTrip
|
|||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
class Trip():
|
class Trip():
|
||||||
|
"""Trip object."""
|
||||||
|
|
||||||
def __init__(self, data: dict):
|
def __init__(self, data: dict):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user