From 1ae32038ec400a1b81292da4b73ca53e76c960d1 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Wed, 2 Apr 2014 19:59:43 +0200 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/superTornado.py b/superTornado.py index d6ddd51..f833c21 100644 --- a/superTornado.py +++ b/superTornado.py @@ -253,7 +253,7 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler): f = urlopen(GlobalVars.urlCamera) temp.write(f.read()) temp.close() - with open("temp","r") as d : + with open("temp","r") as temp : with open("temp2","w") as dest : isData = False for ligne in temp : @@ -265,8 +265,9 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler): if data == "ENDSECTIONEVENT" : isData = True data = f.read() - d.close() - dest.close() + dest.close() + temp.close() + with open("temp2","r") as data : encoded = base64.b64encode(data.read()) f.close()