Пример #1
0
    def search_two_one_ways(self):
        two_one_ways_trip_flight = TwoOneWaysFlightType(self.trip_data)
        flights_to_search = two_one_ways_trip_flight.get_trip_data_requests()

        flight1 = flights_to_search[0]
        flight2 = flights_to_search[1]

        response1 = self.flight_provider.search_flight(flight1)
        response2 = self.flight_provider.search_flight(flight2)

        if response1 and response1 != ERROR_RESPONSE and response2 and response2 != ERROR_RESPONSE:
            two_one_ways_trip_flight.set_trip_data_response(flight1.compute_key(), response1)
            two_one_ways_trip_flight.set_trip_data_response(flight2.compute_key(), response2)
            self.notify_if_cheaper(two_one_ways_trip_flight)
Пример #2
0
def get_connections(origin, dest, date):

    trip_data_request = TripDataRequest(origin, dest, [date], [date])

    two_one_ways_trip_flight = TwoOneWaysFlightType(trip_data_request)
    flights_to_search = two_one_ways_trip_flight.get_trip_data_requests()

    flight1 = flights_to_search[0]

    response1 = flight_provider.search_flight(flight1)

    if response1:
        connections= get_connections_list(response1)

        area = get_area(origin, dest)
        flight_resp_dal.add_connections_to_area(area, connections)