Merge pull request #15 from robholland/rh-python3.4

Ensure that the python runs on 3.4
This commit is contained in:
Steve Androulakis
2025-02-25 04:57:14 -08:00
committed by GitHub

View File

@@ -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,