modifié: m/fichier/conf
modifié: m/loadConf.py modifié: superTornado.py
This commit is contained in:
parent
17d4b31312
commit
af23a6e85a
@ -1,4 +1,5 @@
|
|||||||
blind=1
|
blind=1
|
||||||
camera=192.168.1.13
|
camera=192.168.1.13
|
||||||
portCamera=80
|
portCamera=80
|
||||||
|
serv=192.168.1.12
|
||||||
portServ=80
|
portServ=80
|
||||||
|
@ -24,6 +24,9 @@ class LoadConf(object):
|
|||||||
def portCamera(self) :
|
def portCamera(self) :
|
||||||
return self.loadValue("portCamera")
|
return self.loadValue("portCamera")
|
||||||
|
|
||||||
|
def ipServ(self) :
|
||||||
|
return self.loadValue("serv")
|
||||||
|
|
||||||
def portServ(self) :
|
def portServ(self) :
|
||||||
return self.loadValue("portServ")
|
return self.loadValue("portServ")
|
||||||
|
|
||||||
|
@ -37,8 +37,7 @@ class BaseHandler(tornado.web.RequestHandler):
|
|||||||
|
|
||||||
class MainHandler(BaseHandler):
|
class MainHandler(BaseHandler):
|
||||||
def get(self):
|
def get(self):
|
||||||
urlSocket = 'ws://'+socket.getaddrinfo(socket.gethostname(), None)+':'+portCamera+'/socket'
|
self.render("v/index.html")
|
||||||
self.render("v/index.html", url=urlSocket)
|
|
||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
iden = self.get_argument("id","")
|
iden = self.get_argument("id","")
|
||||||
@ -60,7 +59,7 @@ class VideoHandler(BaseHandler):
|
|||||||
if not self.current_user :
|
if not self.current_user :
|
||||||
self.redirect("/")
|
self.redirect("/")
|
||||||
return
|
return
|
||||||
self.render("v/video.html")
|
self.render("v/video.html", url=urlSocket)
|
||||||
|
|
||||||
class UnauthorizedHandler(BaseHandler):
|
class UnauthorizedHandler(BaseHandler):
|
||||||
def get(self):
|
def get(self):
|
||||||
@ -154,13 +153,16 @@ if __name__ == "__main__":
|
|||||||
blind = config.isBlind()
|
blind = config.isBlind()
|
||||||
ipCamera = config.ipCamera()
|
ipCamera = config.ipCamera()
|
||||||
portCamera = config.portCamera()
|
portCamera = config.portCamera()
|
||||||
|
ipServ = config.ipServ()
|
||||||
portServ = config.portServ()
|
portServ = config.portServ()
|
||||||
if blind == "error" :
|
if blind == "error" :
|
||||||
raise ConfigError("Failed Load Blind Configuration")
|
raise ConfigError("Failed Load Blind Configuration")
|
||||||
if ipCamera == "error" :
|
if ipCamera == "error" :
|
||||||
raise ConfigError("Failed Load IP Camera Configuration")
|
raise ConfigError("Failed Load IP Camera Configuration")
|
||||||
if portCamera == "error" :
|
if portCamera == "error" :
|
||||||
raise ConfigError("Failed Load IP Camera Configuration")
|
raise ConfigError("Failed Load Port Camera Configuration")
|
||||||
|
if ipServ == "error" :
|
||||||
|
raise ConfigError("Failed Load IP Server Configuration")
|
||||||
if portServ == "error" :
|
if portServ == "error" :
|
||||||
raise ConfigError("Failed Load Port Server Configuration")
|
raise ConfigError("Failed Load Port Server Configuration")
|
||||||
except ConfigError as e :
|
except ConfigError as e :
|
||||||
@ -177,6 +179,7 @@ if __name__ == "__main__":
|
|||||||
log.printL(" +Port Server : " + portServ,lvl.INFO)
|
log.printL(" +Port Server : " + portServ,lvl.INFO)
|
||||||
print ""
|
print ""
|
||||||
|
|
||||||
|
urlSocket = 'ws://'+ipServ':'+portCamera+'/socket'
|
||||||
urlCamera = 'http://test:a@'+ipCamera+':'+portCamera+'/image.jpg?cidx=791836195'
|
urlCamera = 'http://test:a@'+ipCamera+':'+portCamera+'/image.jpg?cidx=791836195'
|
||||||
log.printL("->Ping camera ...",lvl.INFO)
|
log.printL("->Ping camera ...",lvl.INFO)
|
||||||
try :
|
try :
|
||||||
|
Reference in New Issue
Block a user