Changeset 305:ddc2dfec2080 for src


Ignore:
Timestamp:
08/18/12 09:43:47 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The aircraft type name of booked flights is handled and is sent in the ACARS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r303 r305  
    156156                    elif key=="planecode": self.aircraftType = \
    157157                         self._decodeAircraftType(value)
     158                    elif key=="planetype": self.aircraftTypeName = value
    158159                    elif key=="tail_nr": self.tailNumber = value
    159160                    elif key=="passenger": self.numPassengers = int(value)
     
    167168                    elif key=="foglalas_id":
    168169                        self.id = None if value=="0" else value
    169                     elif key=="planetype": pass
    170170                    else: lineOK = False
    171171
     
    192192            if attribute not in d:
    193193                raise Exception("Attribute %s could not be read" % (attribute,))
     194
     195        if "aircraftTypeName" not in d:
     196            self.aircraftTypeName = \
     197                BookedFlight.TYPE2TYPECODE[self.aircraftType]
    194198           
    195199    def writeIntoFile(self, f):
     
    202206        print >> f, "planecode=%s" % \
    203207              (BookedFlight.TYPE2TYPECODE[self.aircraftType],)
     208        print >> f, "planetype=%s" % (self.aircraftTypeName,)
    204209        print >> f, "tail_nr=%s" % (self.tailNumber,)
    205210        print >> f, "passenger=%d" % (self.numPassengers,)
     
    222227        typeCode = line[:3]
    223228        self.aircraftType = self._decodeAircraftType(typeCode)
     229        self.aircraftTypeName = line[3:]
    224230
    225231    def _decodeAircraftType(self, typeCode):
     
    845851        data["pass"] = str(bookedFlight.numPassengers)
    846852        data["callsign"] = bookedFlight.callsign
    847         data["airplane"] = BookedFlight.TYPE2TYPECODE[bookedFlight.aircraftType]
     853        data["airplane"] = bookedFlight.aircraftTypeName
    848854        data["from"] = bookedFlight.departureICAO
    849855        data["to"] = bookedFlight.arrivalICAO       
Note: See TracChangeset for help on using the changeset viewer.