Ignore:
Timestamp:
03/14/22 09:58:58 (2 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Updated the flight type handling (re #357)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r1033 r1034  
    147147        return flight
    148148
     149    @staticmethod
     150    def _convertFlightType(ft):
     151        """Convert the in-database flight-type to one of our constants."""
     152        ft = int(ft)
     153        if ft==0:
     154            return const.FLIGHTTYPE_SCHEDULED
     155        elif ft==1:
     156            return const.FLIGHTTYPE_VIP
     157        elif ft==2:
     158            return const.FLIGHTTYPE_CHARTER
     159        else:
     160            return const.FLIGHTTYPE_SCHEDULED
     161
    149162    def __init__(self, id = None):
    150163        """Construct a booked flight with the given ID."""
     
    295308        self.mailWeight = int(bookedFlightData["mailWeight"])
    296309        self.route = bookedFlightData["route"]
     310        self.flightType = BookedFlight._convertFlightType(bookedFlightData["flightType"])
    297311
    298312    def writeIntoFile(self, f):
Note: See TracChangeset for help on using the changeset viewer.