Changeset 1034:4836f52b49cd for src/mlx/rpc.py
- Timestamp:
- 03/14/22 09:58:58 (2 years ago)
- Branch:
- python3
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/rpc.py
r1033 r1034 257 257 raise Exception("Invalid flight status code: '" + status + "'") 258 258 259 @staticmethod 260 def _convertFlightType(ft): 261 """Convert the in-database flight-type to one of our constants.""" 262 ft = int(ft) 263 if ft==0: 264 return const.FLIGHTTYPE_SCHEDULED 265 elif ft==1: 266 return const.FLIGHTTYPE_VIP 267 elif ft==2: 268 return const.FLIGHTTYPE_CHARTER 269 else: 270 return const.FLIGHTTYPE_SCHEDULED 271 259 272 # FIXME: copied from web.BookedFlight 260 273 @staticmethod … … 275 288 # FIXME: copied from web.BookedFlight 276 289 STATUS_REJECTED = 4 277 278 # Flight type: scheduled279 FLIGHT_TYPE_SCHEDULED = 0280 281 # Flight type: VIP282 FLIGHT_TYPE_VIP = 1283 284 # Flight type: charter285 FLIGHT_TYPE_CHARTER = 2286 290 287 291 # The instructions for the construction … … 296 300 "cargoWeight" : int, 297 301 "mailWeight" : int, 298 "flightType" : int,302 "flightType" : lambda value: BookedFlight._convertFlightType(value), 299 303 "dow": int, 300 304 "maxPassengers": int,
Note:
See TracChangeset
for help on using the changeset viewer.