Ignore:
Timestamp:
05/21/18 14:15:25 (6 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Basic functions work with the new website (re #332)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/rpc.py

    r898 r908  
    236236    def _decodeAircraftType(typeCode):
    237237        """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]
    240240        else:
    241241            raise Exception("Invalid aircraft type code: '" + typeCode + "'")
     
    277277    _instructions = {
    278278        "numPassengers" : int,
    279         "numCrew" : int,
     279        "numCockpitCrew" : int,
     280        "numCabinCrew" : int,
    280281        "bagWeight" : int,
    281282        "cargoWeight" : int,
     
    309310        print >> f, "tail_nr=%s" % (self.tailNumber,)
    310311        print >> f, "passenger=%d" % (self.numPassengers,)
    311         print >> f, "crew=%d" % (self.numCrew,)
     312        print >> f, "crew=%d" % (self.numCockpitrew + self.numCabinCrew,)
    312313        print >> f, "bag=%d" % (self.bagWeight,)
    313314        print >> f, "cargo=%d" % (self.cargoWeight,)
     
    518519            self._sessionID = reply.value["sessionID"]
    519520
    520             types = [BookedFlight.TYPECODE2TYPE[typeCode]
     521            types = [const.icao2Type[typeCode]
    521522                     for typeCode in reply.value["typeCodes"]]
    522523
     
    626627        of type codes, if any."""
    627628        typeCodes = None if types is None else \
    628             [BookedFlight.TYPE2TYPECODE[type] for type in types]
     629          [const.icaoCodes[type] for type in types]
    629630
    630631        values = self._performCall(lambda sessionID:
Note: See TracChangeset for help on using the changeset viewer.