Example #1
0
    def link_update(self, store):
        # TODO: Create a parameter for this.
        key = os.environ.get('STOQ_LINK_KEY', '')
        if not key:
            return

        params = {'key': key, 'data': collect_link_statistics(store)}
        return self._do_request('POST', 'api/store', **params)
Example #2
0
    def link_update(self, store):
        # TODO: Create a parameter for this.
        key = os.environ.get('STOQ_LINK_KEY', '')
        if not key:
            return

        params = {
            'key': key,
            'data': collect_link_statistics(store)
        }
        return self._do_request('POST', 'api/store', **params)
Example #3
0
 def callback(response=False):
     """Send data to Stoq Server if the client is using Stoq Link"""
     if not response:
         # On falsy responses we will ignore the next send data
         WebService.send_link_data = False
         return
     # On non falsy responses we will send the next data right away
     WebService.send_link_data = True
     params = {
         'hash': key,
         'data': collect_link_statistics(store)
     }
     return self._do_request('POST', 'api/lite/data', **params)