- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/web.py
r859 r908 73 73 "TU5" : const.AIRCRAFT_T154, 74 74 "YK4" : const.AIRCRAFT_YK40, 75 "146" : const.AIRCRAFT_B462 } 75 "146" : const.AIRCRAFT_B462, 76 "IL6" : const.AIRCRAFT_IL62 } 76 77 77 78 TYPE2TYPECODE = { const.AIRCRAFT_B736 : "736", … … 92 93 const.AIRCRAFT_T154 : "TU5", 93 94 const.AIRCRAFT_YK40 : "YK4", 94 const.AIRCRAFT_B462 : "146" } 95 const.AIRCRAFT_B462 : "146", 96 const.AIRCRAFT_IL62 : "IL6" } 95 97 96 98 checkFlightTypes = [ const.AIRCRAFT_B736, const.AIRCRAFT_B737, … … 128 130 129 131 flight.numPassengers = 0 132 flight.numCockpitCrew = 2 133 flight.numCabinCrew = 2 130 134 flight.numCrew = 2 131 135 flight.bagWeight = 0 … … 246 250 arrivalTime) 247 251 252 self.numCockpitCrew = self.numCrew 253 self.numCabinCrew = 0 254 248 255 d = dir(self) 249 256 for attribute in ["callsign", "departureICAO", "arrivalICAO", 250 "aircraftType", "tailNumber", 251 "num Passengers", "numCrew",257 "aircraftType", "tailNumber", "numPassengers", 258 "numCrew", "numCockpitCrew", "numCabinCrew", 252 259 "bagWeight", "cargoWeight", "mailWeight", 253 260 "route", "departureTime", "arrivalTime"]: … … 279 286 280 287 self.aircraftType = \ 281 self._decodeAircraft Type(bookedFlightData["aircraftType"])288 self._decodeAircraftICAOType(bookedFlightData["aircraftType"]) 282 289 self.tailNumber = bookedFlightData["tailNumber"] 283 290 self.numPassengers = int(bookedFlightData["numPassengers"]) 284 self.numCrew = int(bookedFlightData["numCrew"]) 291 self.numCockpitCrew = int(bookedFlightData["numCockpitCrew"]) 292 self.numCabinCrew = int(bookedFlightData["numCabinCrew"]) 293 self.numCrew = self.numCockpitCrew + self.numCabinCrew 285 294 self.bagWeight = int(bookedFlightData["bagWeight"]) 286 295 self.cargoWeight = int(bookedFlightData["cargoWeight"]) … … 327 336 raise Exception("Invalid aircraft type code: '" + typeCode + "'") 328 337 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 329 345 def __repr__(self): 330 346 """Get a representation of the flight.""" … … 815 831 result.types = loginResult[2] 816 832 result.password = password 833 834 result.aircraftTypes = client.getTypes() 835 817 836 flights = client.getFlights() 818 837 result.flights = flights[0] 819 838 result.reportedFlights = flights[1] 820 839 result.rejectedFlights = flights[2] 840 821 841 if result.rank=="STU": 822 842 reply = client.getEntryExamStatus()
Note:
See TracChangeset
for help on using the changeset viewer.