Changeset 908:fcf3c44650f1 for src/mlx/rpc.py
- Timestamp:
- 05/21/18 14:15:25 (6 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/rpc.py
r898 r908 236 236 def _decodeAircraftType(typeCode): 237 237 """Decode the aircraft type from the given typeCode.""" 238 if typeCode in BookedFlight.TYPECODE2TYPE:239 return BookedFlight.TYPECODE2TYPE[typeCode]238 if typeCode in const.icao2Type: 239 return const.icao2Type[typeCode] 240 240 else: 241 241 raise Exception("Invalid aircraft type code: '" + typeCode + "'") … … 277 277 _instructions = { 278 278 "numPassengers" : int, 279 "numCrew" : int, 279 "numCockpitCrew" : int, 280 "numCabinCrew" : int, 280 281 "bagWeight" : int, 281 282 "cargoWeight" : int, … … 309 310 print >> f, "tail_nr=%s" % (self.tailNumber,) 310 311 print >> f, "passenger=%d" % (self.numPassengers,) 311 print >> f, "crew=%d" % (self.numC rew,)312 print >> f, "crew=%d" % (self.numCockpitrew + self.numCabinCrew,) 312 313 print >> f, "bag=%d" % (self.bagWeight,) 313 314 print >> f, "cargo=%d" % (self.cargoWeight,) … … 518 519 self._sessionID = reply.value["sessionID"] 519 520 520 types = [ BookedFlight.TYPECODE2TYPE[typeCode]521 types = [const.icao2Type[typeCode] 521 522 for typeCode in reply.value["typeCodes"]] 522 523 … … 626 627 of type codes, if any.""" 627 628 typeCodes = None if types is None else \ 628 [BookedFlight.TYPE2TYPECODE[type] for type in types]629 [const.icaoCodes[type] for type in types] 629 630 630 631 values = self._performCall(lambda sessionID:
Note:
See TracChangeset
for help on using the changeset viewer.