示例#1
0
文件: page.py 项目: niczy/Memegen
 def get(self, template_id = None):
     url = self.request.get('url')
     if url:
         #fetch the url then redirect to /makememe/tempalteid
         logging.info("got url is " + url)
         blob_key = meme.fetch_image_to_blobstore(url)
         meme.save_template(blob_key)
         redirect(self, '/makememe/%s' % blob_key)
         return
     render_page(self, 'make_meme', template_id=template_id)
示例#2
0
文件: page.py 项目: niczy/Memegen
 def post(self):
     blob_key = self.request.get('blob_key')
     top_caption = self.request.get('top_caption')
     bottom_caption = self.request.get('bottom_caption')
     style = self.request.get('style')
     fetch_url = self.request.get('fetch_url')
     if fetch_url:
         blob_key = meme.fetch_image_to_blobstore(fetch_url)
         meme.save_template(blob_key)
         self.response.out.write(blob_key) #TODO
     else:
         self.response.out.write(meme.make_meme(blob_key, top_caption, bottom_caption, style, self.uid)) #TODO