From b172309e1451e69c19ade8e26a99f7d37c268890 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Sat, 1 Mar 2014 18:35:37 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20supe?= =?UTF-8?q?rTornado.py=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20video.?= =?UTF-8?q?html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superTornado.py | 11 +++++++++++ video.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/superTornado.py b/superTornado.py index 5b8965f..f2c6ffc 100644 --- a/superTornado.py +++ b/superTornado.py @@ -95,6 +95,17 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler): print 'maison.request("GET", "micom/lamp.php?room=salon1&order=1")' print "->Authorized user access" + try : + socket.setdefaulttimeout(5) + f = urlopen('http://test:a@192.168.0.13/image.jpg?cidx=791836195') + data = f.read() + encoded = base64.b64encode(data) + self.write_message(encoded) + except Exception, e : + print e + self.write_message("error") + + def on_message(self,mesg): print "->Data receive" try : diff --git a/video.html b/video.html index 283f069..3c3bd6a 100644 --- a/video.html +++ b/video.html @@ -19,7 +19,7 @@ return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});v } else { console.log("data NOK !"); - var str = "

Erreur : image camera indisponilbe

"; + var str = "

Erreur : image camera indisponible

"; } $('.image').html(str); }