Changeset 856:215eccff5185


Ignore:
Timestamp:
05/21/17 18:13:33 (7 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

PIREP processing is more resilient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/pirep.py

    r855 r856  
    6868            if s==text:
    6969                return flighType
    70         return const.FLIGHTYPE_SCHEDULED
     70        return const.FLIGHTTYPE_SCHEDULED
    7171
    7272    @staticmethod
     
    188188        self.mailWeight = int(pirepData["mailWeight"])
    189189
    190         self.filedCruiseAltitude = int(pirepData["filedCruiseLevel"][2:])*100
     190        filedCruiseLevel = pirepData["filedCruiseLevel"].strip()
     191        if filedCruiseLevel:
     192            if filedCruiseLevel.startswith("FL"):
     193                filedCruiseLevel = filedCruiseLevel[2:]
     194        if filedCruiseLevel:
     195            self.filedCruiseAltitude = int(filedCruiseLevel)*100
     196        else:
     197            self.filedCruiseAltitude = 10000;
     198
    191199        cruiseLevel = pirepData["cruiseLevel"].strip()
    192200        if cruiseLevel:
Note: See TracChangeset for help on using the changeset viewer.