Beispiel #1
0
 def queryTask(self, taskKey):
  task = ndb.Key(Task, int(taskKey)).get()
  if not task:
   return self.error(404)
  return {
   'completed': task.completed,
   'response': marketserver.parsePostData(task.response) if task.completed else None,
  }
Beispiel #2
0
 def get(self, taskKey):
  task = ndb.Key(Task, int(taskKey)).get()
  if not task:
   return self.error(404)
  self.template('task/view.html', {
   'completed': task.completed,
   'response': marketserver.parsePostData(task.response) if task.completed else None,
  })
Beispiel #3
0
 def get(self, taskKey):
     task = ndb.Key(Task, int(taskKey)).get()
     if not task:
         return self.error(404)
     self.template(
         'task/view.html', {
             'completed':
             task.completed,
             'response':
             marketserver.parsePostData(task.response)
             if task.completed else None,
         })
Beispiel #4
0
 def post(self):
  data = self.request.body
  taskKey = int(marketserver.parsePostData(data)['session']['correlationid'])
  task = ndb.Key(Task, taskKey).get()
  if not task:
   return self.error(404)
  if not task.completed and task.blob:
   response = marketserver.getJsonInstallResponse('App', self.uri_for('blobSpk', blobKey = task.blob, _full = True))
  elif not task.completed and task.app:
   response = marketserver.getJsonInstallResponse('App', self.uri_for('appSpk', appId = task.app, _full = True))
  else:
   response = marketserver.getJsonResponse()
  task.completed = True
  task.response = data
  task.put()
  self.output(marketserver.constants.jsonMimeType, response)
Beispiel #5
0
 def post(self):
     data = self.request.body
     dataDict = marketserver.parsePostData(data)
     taskKey = int(dataDict.get('session', {}).get('correlationid', 0))
     task = ndb.Key(Task, taskKey).get()
     if not task:
         return self.error(404)
     if not task.completed and task.app:
         response = marketserver.getJsonInstallResponse(
             'App', self.uri_for('appSpk', appId=task.app, _full=True))
     else:
         response = marketserver.getJsonResponse()
     task.completed = True
     task.response = data
     task.put()
     updateAppStats(dataDict)
     self.output(marketserver.constants.jsonMimeType, response)
Beispiel #6
0
 def post(self):
     data = self.request.body
     taskKey = int(
         marketserver.parsePostData(data)['session']['correlationid'])
     task = ndb.Key(Task, taskKey).get()
     if not task:
         return self.error(404)
     if not task.completed and task.blob:
         response = marketserver.getJsonInstallResponse(
             'App', self.uri_for('blobSpk', blobKey=task.blob, _full=True))
     elif not task.completed and task.app:
         response = marketserver.getJsonInstallResponse(
             'App', self.uri_for('appSpk', appId=task.app, _full=True))
     else:
         response = marketserver.getJsonResponse()
     task.completed = True
     task.response = data
     task.put()
     self.output(marketserver.constants.jsonMimeType, response)