Ignore:
Timestamp:
06/08/17 18:36:07 (7 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The timetable can be queried, displayed and filtered (re #304)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r854 r858  
    813813            result.pilotName = loginResult[0]
    814814            result.rank = loginResult[1]
     815            result.types = loginResult[2]
    815816            result.password = password
    816817            flights = client.getFlights()
     
    825826                if reply[3]:
    826827                    result.rank = "FO"
     828
    827829
    828830    def __init__(self, client, callback, pilotID, password):
     
    13421344#------------------------------------------------------------------------------
    13431345
     1346class GetTimetable(RPCRequest):
     1347    """Request to get the timetable."""
     1348    def __init__(self, client, callback, date, types):
     1349        """Construct the request with the given client and callback function."""
     1350        super(GetTimetable, self).__init__(client, callback)
     1351        self._date = date
     1352        self._types = types
     1353
     1354    def run(self):
     1355        """Perform the login request."""
     1356        result = Result()
     1357
     1358        result.flightPairs = self._client.getTimetable(self._date, self._types)
     1359
     1360        return result
     1361
     1362#------------------------------------------------------------------------------
     1363
    13441364class Handler(threading.Thread):
    13451365    """The handler for the web services.
     
    14391459        self._addRequest(GetAcceptedFlights(self._rpcClient, callback))
    14401460
     1461    def getTimetable(self, callback, date, types):
     1462        """Enqueue a request to get the timetable."""
     1463        self._addRequest(GetTimetable(self._rpcClient, callback, date, types))
     1464
    14411465    def run(self):
    14421466        """Process the requests."""
Note: See TracChangeset for help on using the changeset viewer.