Exemple #1
0
 def post(self):
     status = self.request.get("status")
     handle = self.request.get("handle")
     signature = self.request.get("signature")
     check_param(self.response, "handle", handle)
     check_param(self.response, "signature", signature)
     check_signature(self.response, handle, signature)
     if status:
         image = find_image_by_handle(handle)
         image.put()
Exemple #2
0
 def get(self):
     handle = self.request.get("handle")
     signature = self.request.get("signature")
     check_param(self.response, "handle", handle)
     check_param(self.response, "signature", signature)
     check_signature(self.response, handle, signature)
     image = find_image_by_handle(handle)
     self.response.headers['Content-Type'] = 'application/json'
     response = { 'handle': image.handle, 'created_at': image.created_at.isoformat(), 'status': image.status }
     self.response.out.write(simplejson.dumps(response))
Exemple #3
0
 def get(self):
     handle = self.request.get("handle")
     signature = self.request.get("signature")
     check_param(self.response, "handle", handle)
     check_param(self.response, "signature", signature)
     check_signature(self.response, handle, signature)
     image = find_image_by_handle(handle)
     if image:
         blobstore.delete(image.blob_key.key())
         response = { 'handle': handle, 'created_at': image.created_at.isoformat(), 'status': 'deleted' }
         image.delete()
     else:
         response = { 'handle': handle, 'status': 'not found' }
     self.response.headers['Content-Type'] = 'application/json'
     self.response.out.write(simplejson.dumps(response))
Exemple #4
0
 def get(self):
     handle = self.request.get("handle")
     signature = self.request.get("signature")
     upload_url = blobstore.create_upload_url('/image/submit')
     if check_param(self.response, "handle", handle) and \
         check_param(self.response, "signature", signature) and \
         check_signature(self.response, handle, signature):
         response = { 'handle': handle, 'signature': signature, 'post_to': upload_url }
         self.response.headers['Content-Type'] = 'application/json'
         self.response.out.write(simplejson.dumps(response))