def make_flight():
    a1 = Aircraft("blah", "airbus", 22, 6)
    flight = Flight("SN066", a1)
    print(flight, type(flight))
    print(flight.number())
    flight.alllocate_seat("1C", "John")
    flight.alllocate_seat("11C", "Cindy")
    return flight
示例#2
0
def make_flight():
    """
    Generate a dummy flight for us
    :return: Dummy flight information
    """
    flight = Flight("SN066",
                    Aircraft("G-EUP", "CRJ", num_rows=20, num_seats_row=4))
    flight.allocate_seat("2A", "Jane Doe")
    flight.allocate_seat("4D", "John Smith")
    flight.allocate_seat("20C", "Larry Wall")
    return flight
示例#3
0
def make_flight():
    flight = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))
    # pp(f1._seating)
    flight.allocate_seat("02A", "Wayne Widdison")
    flight.allocate_seat("12B", "Rasmus Lerdorf")
    flight.allocate_seat("15F", "Bjare Larsen")
    flight.allocate_seat("03A", "Yakob Smirnoff")
    flight.allocate_seat("16F", "Yukihiro Matsumoto")
    return flight
示例#4
0
def make_flight():
    flight = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))

    flight.allocate_seat('11C', "Guido Van Rossum")
    flight.allocate_seat('11F', "Jack Sprat")
    flight.allocate_seat('02A', "Jack Sprat Jr.")

    pp(flight._seating)
    return flight
示例#5
0
def make_flight():
    flight = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))
    # pp(flight._seating)
    flight.allocate_seat("02A", "Guido Van Rossum")  # python
    flight.allocate_seat("22B", "Rasmus Lerdorf")  # php
    flight.allocate_seat("15F", "Bjare Stroustrup")  # C++
    flight.allocate_seat("03A", "Larry Wall")  #perl
    flight.allocate_seat("16F", "Yukihiro Matsumoto")  #ruby
    return flight
示例#6
0
def make_flight():
    flight = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))
    pp(flight._seating)
    flight.allocate_seat("1A", "Guido Van Rossum")  # Python creator
    flight.allocate_seat("6C", "Rasmus Lerdorf")  # php author
    flight.allocate_seat("05D", "Bjare")  # C++
    flight.allocate_seat("6F", "Larry")  # Created Perl
    flight.allocate_seat("20E", "Yukihiro")  # Wrote Ruby
    return flight
示例#7
0
def make_flight():
    f1ight = Flight("SN067", Aircraft("G-EUP", "Airbus A319", num_rows=22,
                                  num_seats_per_row=6))

    # pp(f1._seating)

    f1ight.allocate_seat("02A", "Guido Van Rossum")
    f1ight.allocate_seat("12B", "rasmus Lefdorf")
    f1ight.allocate_seat("15F", "Bjare Stroustrup")
    f1ight.allocate_seat("03A", "Yudihiro Matsumoto")
    return f1ight
示例#8
0
def make_flight():
    numrows = 22
    seatsper = 6
    flight = Flight("SN066",
                Aircraft("G-EUP",
                         "Airbus A319",
                         numrows,
                         seatsper))
    # pp(f1._seating)
    flight.allocates("12E", "Guide Van Rosen")
    flight.allocates("12B", "Sam Shafter")
    flight.allocates("20E", "Jimmy Hancock")
    flight.allocates("05A", "Del Ray Bell")
    flight.allocates("12C", "Brent Timothy")
    return flight
示例#9
0
def make_flight():
    """
    Test function
    :return: Nothing
    """
    flight = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))
    # pp(f1._seating)
    flight.allocate_seat("02A", "Guido Van Rossum")
    flight.allocate_seat("12B", "Rasums Lerdorf")
    flight.allocate_seat("15F", "Bjare Stroustrup")
    flight.allocate_seat("03A", "Larry Wall")
    flight.allocate_seat("16F", "Yukihiro Matsumoto")
    return flight
def main():
    """
    Test function
    :return:
    """
    f1 = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))
    pp(f1._seating)
    f1.allocate_seat("02A", "Guido Van Rossum")  # python
    f1.allocate_seat("12B", "Rasmus Lerdorf")  # PHP
    f1.allocate_seat("15F", "Bjare Straoustrup")  # C++
    f1.allocate_seat("03A", "Larry Wall")  # perl
    f1.allocate_seat("16F", "Yukihiro Matsumoto")  # ruby
    pp(f1._seating)
示例#11
0
def make_flight():
    """

    :return:
    """

    flight = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))

    flight.allocate_seat("02A", "Guido Van Rossum")
    flight.allocate_seat("12B", "Rasmus Lerdorf")
    flight.allocate_seat("15F", "Bjanre Stroustrup")
    flight.allocate_seat("03A", "Larry Wall")
    flight.allocate_seat("16F", "Yukihiro Mastsumoto")

    return flight
示例#12
0
def my_code():
    """
    Test function
    :return: 
    """

    flight_1 = make_flight()
    flight_1 = Flight(
        "SN066",
        Aircraft("G-EUP", "Airbus A319", num_rows=22, num_seats_per_row=6))

    pp(flight_1._seating)
    # Count the Nones
    #capacity = flight_1._aircraft.seating_plan()
    print("Available seats", flight_1.num_available_seats())
    flight_1.make_bording_class(console_card_printer)
    # don't include the function i.e., the paranthesis.

    return flight_1
def make_flight():
    """

    :return:
    """
    flight = Flight("SN066", Aircraft("G-EUP", "Airbus A319", num_rows= 22, num_seats_per_row= 6))

    # print(a1.registration(), a1.model()))
    # print(flight.number(), flight.airline())
    # f2 = Flight("SN013")
    # print(f2.number(), f2.airline())
    # # could use: Flight.number(f) horrible notation
    # a1 = Aircraft("G-EUP", "Airbus A319", num_rows= 22, num_seats_per_row= 6)
    # print(a1.registration(), a1.model())
    # pp(f1._seating)
    flight.allocate_seat("02A", "Guido Van Roussum")
    flight.allocate_seat("02F", "Van Roussum")
    flight.allocate_seat("02B", "Van")
    # flight.allocate_seat("02A", "Guido Roussum")
    return flight
示例#14
0
from airtravel import Flight
from airtravel import Aircraft

possible_flights = {'joke':, 'AP564', '23' , 'casa']
for flight in possible_flights:
    try:
        result = Flight(flight)
        print(result)
    except ValueError as Erro:
        print(Erro)

aircraft = Aircraft('AZUL','487', 21, 7)
model = aircraft.model()
registration = aircraft.registration()
seats = aircraft.seating_plan()
print(seats, model, registration)
示例#15
0
from airtravel import Flight, Aircraft

f = Flight("KO1234")
a = Aircraft("G-EUPT", "Airbus A333", 22, 6)

print(a.registration())
print(a.seating_plan())
示例#16
0
from airtravel import Flight, Aircraft
from pprint import pprint as pp

aa = Aircraft("AD", "AIRBUS", 40, 8)

f = Flight("QA780", aa)

pp(f._seating)

f.allocate_seat('3A', 'Prem')
f.allocate_seat('3B', 'Priya')

pp(f._seating)

f.allocate_seat('3B', 'Alia')
示例#17
0
from airtravel import Flights, Aircraft,console_card_printer
from pprint import pprint as pp

a = Aircraft("E-GUP","Airbus A319",num_rows=22,num_seats_per_row=4)

print(a.seating_plan())

objf=Flights("SN99999",Aircraft("E-GUP","Airbus A319",num_rows=22,num_seats_per_row=4))

print(objf.aircraft_model())

print(objf._seating[12]["A"])

objf.allocate_seat("12A","gani")
objf.allocate_seat("13A","bani")
objf.allocate_seat("14C","hani")
objf.allocate_seat("09C","sani")
objf.allocate_seat("08C","pani")
objf.relocate_passenger("12A","15A")
# objf.allocate_seat("12A","django")

# print(objf._seating[13]["A"])

# print (objf.available_seats())

objf.make_boarding_pass(console_card_printer)



# pp(objf._seating)