Beispiel #1
0
 def setUp(self):
     data = json.loads(open("../map_data.json").read())
     self.CSAir = Network(data)
Beispiel #2
0
        first_file = True
    return master_data


'''
The main code that is actually executed
'''
file_list = []
file_name = ""
while (file_name != "exit"):
    file_name = raw_input(
        "Please enter the files you want to populate the network with. ")
    if (file_name != "exit"):
        file_list.append(file_name)
json_data = generate_data(file_list)
CSAir = Network(json_data)

#A list of commands that includes the text printed for the query, and the function called as a result of selecting that query

commands = [
    ["Print serviced cities.", CSAir.print_cities],
    [
        "Print a list of serviced continents with their serviced cities",
        CSAir.print_continents_and_cities
    ], ["Print city information.", CSAir.print_city_information],
    ["Print the longest flight.", CSAir.print_longest_flight],
    ["Print the shortest flight.", CSAir.print_shortest_flight],
    [
        "Print the average flight distance.",
        CSAir.print_average_flight_distance
    ],