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["apiKey"]) if (departures == None): return False, False, stationName firstDepartureDestinations = departures[0]["calling_at_list"] return departures, firstDepartureDestinations, stationName
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