modifié: superTornado.py

This commit is contained in:
sidya82 2014-02-28 01:41:59 +01:00
parent e8281caa2f
commit 17eee21632
1 changed files with 11 additions and 1 deletions

View File

@ -48,7 +48,17 @@ class VideoHandler(BaseHandler):
self.redirect("/")
return
name = tornado.escape.xhtml_escape(self.current_user)
self.render("video.html")
with open("image/temp.jpg", 'rb') as f:
data = f.read()
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image()
self.set_header('Content-type', 'image/png')
img_buff = StringIO()
img.save(img_buff)
img_buff.seek(0)
self.write(img_buff.read())
self.finish()
class UnauthorizedHandler(BaseHandler):
def get(self):