diff --git a/thirdparty/train_api.py b/thirdparty/train_api.py index e881c5a..ca6c2ae 100644 --- a/thirdparty/train_api.py +++ b/thirdparty/train_api.py @@ -44,7 +44,9 @@ class TrainServer(BaseHTTPRequestHandler): # Helper to format datetime def format_datetime(year, month, day, hour, minute): - return f"{year:04d}-{month:02d}-{day:02d}T{hour:02d}:{minute:02d}" + return "{year:04d}-{month:02d}-{day:02d}T{hour:02d}:{minute:02d}".format( + year=year, month=month, day=day, hour=hour, minute=minute + ) # Generate outbound journeys year, month, day, hour, minute = out_datetime @@ -66,7 +68,7 @@ class TrainServer(BaseHTTPRequestHandler): arr_hour = arr_hour % 24 journey = { - "id": f"T{random.randint(1000, 9999)}", + "id": "T%s".format(random.randint(1000, 9999)), "type": "outbound", "departure": origin, "arrival": destination, @@ -99,7 +101,7 @@ class TrainServer(BaseHTTPRequestHandler): arr_hour = arr_hour % 24 journey = { - "id": f"T{random.randint(1000, 9999)}", + "id": "T%s".format(random.randint(1000, 9999)), "type": "return", "departure": destination, "arrival": origin,