Changeset 305:ddc2dfec2080 for src/mlx
- Timestamp:
- 08/18/12 09:43:47 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/web.py
r303 r305 156 156 elif key=="planecode": self.aircraftType = \ 157 157 self._decodeAircraftType(value) 158 elif key=="planetype": self.aircraftTypeName = value 158 159 elif key=="tail_nr": self.tailNumber = value 159 160 elif key=="passenger": self.numPassengers = int(value) … … 167 168 elif key=="foglalas_id": 168 169 self.id = None if value=="0" else value 169 elif key=="planetype": pass170 170 else: lineOK = False 171 171 … … 192 192 if attribute not in d: 193 193 raise Exception("Attribute %s could not be read" % (attribute,)) 194 195 if "aircraftTypeName" not in d: 196 self.aircraftTypeName = \ 197 BookedFlight.TYPE2TYPECODE[self.aircraftType] 194 198 195 199 def writeIntoFile(self, f): … … 202 206 print >> f, "planecode=%s" % \ 203 207 (BookedFlight.TYPE2TYPECODE[self.aircraftType],) 208 print >> f, "planetype=%s" % (self.aircraftTypeName,) 204 209 print >> f, "tail_nr=%s" % (self.tailNumber,) 205 210 print >> f, "passenger=%d" % (self.numPassengers,) … … 222 227 typeCode = line[:3] 223 228 self.aircraftType = self._decodeAircraftType(typeCode) 229 self.aircraftTypeName = line[3:] 224 230 225 231 def _decodeAircraftType(self, typeCode): … … 845 851 data["pass"] = str(bookedFlight.numPassengers) 846 852 data["callsign"] = bookedFlight.callsign 847 data["airplane"] = BookedFlight.TYPE2TYPECODE[bookedFlight.aircraftType]853 data["airplane"] = bookedFlight.aircraftTypeName 848 854 data["from"] = bookedFlight.departureICAO 849 855 data["to"] = bookedFlight.arrivalICAO
Note:
See TracChangeset
for help on using the changeset viewer.