modifié: superTornado.py
This commit is contained in:
parent
d58e3cf748
commit
be4b20b198
@ -78,12 +78,15 @@ class AJAXHandler(BaseHandler):
|
|||||||
if not self.current_user :
|
if not self.current_user :
|
||||||
self.redirect("/")
|
self.redirect("/")
|
||||||
return
|
return
|
||||||
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195', 'image/temp.jpg')
|
try :
|
||||||
data = f.read()
|
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195', 'image/temp.jpg')
|
||||||
encoded = base64.b64encode(data)
|
data = f.read()
|
||||||
print encoded
|
encoded = base64.b64encode(data)
|
||||||
self.write(encoded)
|
print encoded
|
||||||
self.finish()
|
self.write(encoded)
|
||||||
|
self.finish()
|
||||||
|
except Exception, e :
|
||||||
|
self.write_error("Camera unavailable")
|
||||||
|
|
||||||
class DisconnectionHandler(BaseHandler):
|
class DisconnectionHandler(BaseHandler):
|
||||||
def post(self):
|
def post(self):
|
||||||
|
Reference in New Issue
Block a user