Ignore:
Timestamp:
06/18/17 11:17:51 (7 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Flight booking works (re #304).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r858 r859  
    13621362#------------------------------------------------------------------------------
    13631363
     1364class BookFlights(RPCRequest):
     1365    """Request to book flights."""
     1366    def __init__(self, client, callback, flightIDs, date, tailNumber):
     1367        """Construct the request with the given client and callback function."""
     1368        super(BookFlights, self).__init__(client, callback)
     1369        self._flightIDs = flightIDs
     1370        self._date = date
     1371        self._tailNumber = tailNumber
     1372
     1373    def run(self):
     1374        """Perform the login request."""
     1375        result = Result()
     1376
     1377        result.bookedFlights = self._client.bookFlights(self._flightIDs,
     1378                                                        self._date,
     1379                                                        self._tailNumber)
     1380
     1381        return result
     1382
     1383#------------------------------------------------------------------------------
     1384
    13641385class Handler(threading.Thread):
    13651386    """The handler for the web services.
     
    14631484        self._addRequest(GetTimetable(self._rpcClient, callback, date, types))
    14641485
     1486    def bookFlights(self, callback, flightIDs, date, tailNumber):
     1487        """Enqueue a request to book some flights."""
     1488        self._addRequest(BookFlights(self._rpcClient, callback,
     1489                                     flightIDs, date, tailNumber))
     1490
    14651491    def run(self):
    14661492        """Process the requests."""
Note: See TracChangeset for help on using the changeset viewer.