Exemple #1
0
def loadData(apiConfig, journeyConfig):
    departures = loadDeparturesForStation(
        journeyConfig, apiConfig["appId"], apiConfig["apiKey"])
    firstDepartureDestinations = loadDestinationsForDeparture(
        departures[0]["service_timetable"]["id"])

    return departures, firstDepartureDestinations
def loadData(apiConfig, journeyConfig):
    departures, stationName = loadDeparturesForStation(journeyConfig,
                                                       apiConfig["appId"],
                                                       apiConfig["apiKey"])

    if len(departures) == 0:
        return False, False, stationName

    firstDepartureDestinations = loadDestinationsForDeparture(
        departures[0]["service_timetable"]["id"])

    return departures, firstDepartureDestinations, stationName
Exemple #3
0
    def __init__(self, departure, stationCode):
        self.platform = departure["platform"]
        if not (self.platform):
            self.platform = "?"

        service = departure["service"]
        serviceData = loadDestinationsForDeparture(
            departure["service_timetable"]["id"], service)
        self.stops = serviceData["stops"]

        self.aimed_time = departure["aimed_departure_time"]
        self.origin_name = departure["origin_name"]
        self.destination_name = departure["destination_name"]
Exemple #4
0
def loadData(apiConfig, journeyConfig):
    runHours = [int(x) for x in apiConfig['operatingHours'].split('-')]
    if isRun(runHours[0], runHours[1]) == False:
        return False, False, journeyConfig['outOfHoursName']

    departures, stationName = loadDeparturesForStation(
        journeyConfig, apiConfig["appId"], apiConfig["apiKey"])

    if len(departures) == 0:
        return False, False, stationName

    firstDepartureDestinations = loadDestinationsForDeparture(
        journeyConfig, departures[0]["service_timetable"]["id"])

    return departures, firstDepartureDestinations, stationName