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

PIREP modifications can be saved (re #307)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r829 r853  
    11441144    """A request to send a PIREP to the MAVA website via the RPC interface."""
    11451145
    1146     def __init__(self, client, callback, pirep):
     1146    def __init__(self, client, callback, pirep, update):
    11471147        """Construct the sending of the PIREP."""
    11481148        super(SendPIREPRPC, self).__init__(client, callback)
    11491149        self._pirep = pirep
     1150        self._update = update
    11501151
    11511152    def run(self):
    11521153        """Perform the sending of the PIREP."""
    11531154        pirep = self._pirep
    1154         resultCode = self._client.addPIREP(pirep.bookedFlight.id, pirep)
     1155        resultCode = self._client.addPIREP(pirep.bookedFlight.id, pirep,
     1156                                           self._update)
    11551157
    11561158        result = Result()
     
    12861288        print "pirepData:", pirepData
    12871289
    1288         bookedFlight = BookedFlight()
     1290        bookedFlight = BookedFlight(self._flightID)
    12891291        bookedFlight.setupFromPIREPData(pirepData)
    12901292
     
    13821384        self._addRequest(GetMETARs(callback, airports))
    13831385
    1384     def sendPIREP(self, callback, pirep):
     1386    def sendPIREP(self, callback, pirep, update = False):
    13851387        """Send the given PIREP."""
    13861388        request = \
    1387           SendPIREPRPC(self._rpcClient, callback, pirep) if self._config.useRPC \
    1388           else SendPIREP(callback, pirep)
     1389          SendPIREPRPC(self._rpcClient, callback, pirep, update) \
     1390          if self._config.useRPC else SendPIREP(callback, pirep)
    13891391        self._addRequest(request)
    13901392
Note: See TracChangeset for help on using the changeset viewer.