From 17eee21632afa179dc0db16cb68a2cab4f0959d1 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Fri, 28 Feb 2014 01:41:59 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20supe?= =?UTF-8?q?rTornado.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superTornado.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/superTornado.py b/superTornado.py index d144df4..0b23ccd 100644 --- a/superTornado.py +++ b/superTornado.py @@ -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):