Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r908 r859  
    7373                      "TU5"  : const.AIRCRAFT_T154,
    7474                      "YK4"  : const.AIRCRAFT_YK40,
    75                       "146"  : const.AIRCRAFT_B462,
    76                       "IL6"  : const.AIRCRAFT_IL62 }
     75                      "146"  : const.AIRCRAFT_B462 }
    7776
    7877    TYPE2TYPECODE = { const.AIRCRAFT_B736  : "736",
     
    9392                      const.AIRCRAFT_T154  : "TU5",
    9493                      const.AIRCRAFT_YK40  : "YK4",
    95                       const.AIRCRAFT_B462  : "146",
    96                       const.AIRCRAFT_IL62  : "IL6" }
     94                      const.AIRCRAFT_B462  : "146" }
    9795
    9896    checkFlightTypes = [ const.AIRCRAFT_B736, const.AIRCRAFT_B737,
     
    130128
    131129        flight.numPassengers = 0
    132         flight.numCockpitCrew = 2
    133         flight.numCabinCrew = 2
    134130        flight.numCrew = 2
    135131        flight.bagWeight = 0
     
    250246                                                            arrivalTime)
    251247
    252         self.numCockpitCrew = self.numCrew
    253         self.numCabinCrew = 0
    254 
    255248        d = dir(self)
    256249        for attribute in ["callsign", "departureICAO", "arrivalICAO",
    257                           "aircraftType", "tailNumber", "numPassengers",
    258                           "numCrew", "numCockpitCrew", "numCabinCrew",
     250                          "aircraftType", "tailNumber",
     251                          "numPassengers", "numCrew",
    259252                          "bagWeight", "cargoWeight", "mailWeight",
    260253                          "route", "departureTime", "arrivalTime"]:
     
    286279
    287280        self.aircraftType = \
    288           self._decodeAircraftICAOType(bookedFlightData["aircraftType"])
     281          self._decodeAircraftType(bookedFlightData["aircraftType"])
    289282        self.tailNumber = bookedFlightData["tailNumber"]
    290283        self.numPassengers = int(bookedFlightData["numPassengers"])
    291         self.numCockpitCrew = int(bookedFlightData["numCockpitCrew"])
    292         self.numCabinCrew = int(bookedFlightData["numCabinCrew"])
    293         self.numCrew = self.numCockpitCrew + self.numCabinCrew
     284        self.numCrew = int(bookedFlightData["numCrew"])
    294285        self.bagWeight = int(bookedFlightData["bagWeight"])
    295286        self.cargoWeight = int(bookedFlightData["cargoWeight"])
     
    336327            raise Exception("Invalid aircraft type code: '" + typeCode + "'")
    337328
    338     def _decodeAircraftICAOType(self, typeCode):
    339         """Decode the aircraft type from the given typeCode."""
    340         if typeCode in const.icao2Type:
    341             return const.icao2Type[typeCode]
    342         else:
    343             raise Exception("Invalid aircraft type code: '" + typeCode + "'")
    344 
    345329    def __repr__(self):
    346330        """Get a representation of the flight."""
     
    831815            result.types = loginResult[2]
    832816            result.password = password
    833 
    834             result.aircraftTypes = client.getTypes()
    835 
    836817            flights = client.getFlights()
    837818            result.flights = flights[0]
    838819            result.reportedFlights = flights[1]
    839820            result.rejectedFlights = flights[2]
    840 
    841821            if result.rank=="STU":
    842822                reply = client.getEntryExamStatus()
Note: See TracChangeset for help on using the changeset viewer.