Пример #1
0
def download_airport_xml():
    return FlightInformationService.download_airport_xml()
Пример #2
0
    default=False,
)
parser.add_option(
    "--arrivals",
    action="store_true",
    dest="arrivals_only",
    help="Print information about only arrivals.",
    default=False,
)


(options, args) = parser.parse_args()
airportname = args[0]


airports_xml = FlightInformationService.download_airport_xml()
airports = AirPortParser.parse_airports(airports_xml)
airport_factory = AirPortFactory(airports)

airlines_xml = FlightInformationService.download_airline_xml()
airlines = AirlineParser.parse_airlines(airlines_xml)
airline_factory = AirlineFactory(airlines)

status_xml = FlightInformationService.download_flight_status_xml()
statuses = FlightStatusParser.parse_statuses(status_xml)
status_factory = FlightStatusFactory(statuses)

airport = airport_factory.get_airport_by_code(airportname)
query = Query(airport)
xml = FlightInformationService.download_flight_xml(query)