Adjust code formatting.
This commit is contained in:
parent
4143190a8a
commit
f718535624
1 changed files with 9 additions and 3 deletions
|
|
@ -409,7 +409,9 @@ def get_trip_routes(trip: Trip, data_dir: str) -> list[StrDict]:
|
||||||
# Use GeoJSON route when available, otherwise draw straight line
|
# Use GeoJSON route when available, otherwise draw straight line
|
||||||
if t.get("geojson_filename"):
|
if t.get("geojson_filename"):
|
||||||
filename = os.path.join("coach_routes", t["geojson_filename"])
|
filename = os.path.join("coach_routes", t["geojson_filename"])
|
||||||
routes.append({"type": "coach", "key": key, "geojson_filename": filename})
|
routes.append(
|
||||||
|
{"type": "coach", "key": key, "geojson_filename": filename}
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
routes.append(
|
routes.append(
|
||||||
{
|
{
|
||||||
|
|
@ -424,7 +426,9 @@ def get_trip_routes(trip: Trip, data_dir: str) -> list[StrDict]:
|
||||||
for leg in t["legs"]:
|
for leg in t["legs"]:
|
||||||
train_from, train_to = leg["from_station"], leg["to_station"]
|
train_from, train_to = leg["from_station"], leg["to_station"]
|
||||||
geojson_filename = train_from.get("routes", {}).get(train_to["name"])
|
geojson_filename = train_from.get("routes", {}).get(train_to["name"])
|
||||||
key = "_".join(["train"] + sorted([train_from["name"], train_to["name"]]))
|
key = "_".join(
|
||||||
|
["train"] + sorted([train_from["name"], train_to["name"]])
|
||||||
|
)
|
||||||
if not geojson_filename:
|
if not geojson_filename:
|
||||||
routes.append(
|
routes.append(
|
||||||
{
|
{
|
||||||
|
|
@ -444,7 +448,9 @@ def get_trip_routes(trip: Trip, data_dir: str) -> list[StrDict]:
|
||||||
{
|
{
|
||||||
"type": "train",
|
"type": "train",
|
||||||
"key": key,
|
"key": key,
|
||||||
"geojson_filename": os.path.join("train_routes", geojson_filename),
|
"geojson_filename": os.path.join(
|
||||||
|
"train_routes", geojson_filename
|
||||||
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue