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