modifié: m/fichier/conf

modifié:         m/loadConf.py
	modifié:         superTornado.py
This commit is contained in:
sidya82 2014-03-23 14:07:15 +01:00
parent 1e41ef6bc4
commit 820ca476c7
3 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,7 @@
blind=1 blind=1
camera=192.168.1.13 camera=192.168.1.13
portCamera=80 portCamera=80
idCamera=test:a idUrlCamera=test:a
endUrlCamera=image.jpg?cidx=791836195 endUrlCamera=image.jpg?cidx=791836195
serv=192.168.1.12 serv=192.168.1.12
portServ=80 portServ=80

View File

@ -56,11 +56,11 @@ class LoadConf(object):
return self.loadValue("portServ") return self.loadValue("portServ")
""" """
Return idCamera configuration Return idUrlCamera configuration
Else "error" Else "error"
""" """
def idCamera(self) : def idUrlCamera(self) :
return self.loadValue("idCamera") return self.loadValue("idUrlCamera")
""" """
Return endUrlCamera configuration Return endUrlCamera configuration

View File

@ -230,6 +230,7 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler):
f = urlopen(GlobalVars.urlCamera) f = urlopen(GlobalVars.urlCamera)
data = f.read() data = f.read()
encoded = base64.b64encode(data) encoded = base64.b64encode(data)
f.close()
self.write_message(encoded) self.write_message(encoded)
GlobalVars.log.printL( "->Image Data Send : " + self.request.remote_ip, lvl.INFO) GlobalVars.log.printL( "->Image Data Send : " + self.request.remote_ip, lvl.INFO)
except Exception, e : except Exception, e :
@ -255,7 +256,7 @@ if __name__ == "__main__":
GlobalVars.blind = GlobalVars.config.isBlind() GlobalVars.blind = GlobalVars.config.isBlind()
GlobalVars.ipCamera = GlobalVars.config.ipCamera() GlobalVars.ipCamera = GlobalVars.config.ipCamera()
GlobalVars.portCamera = GlobalVars.config.portCamera() GlobalVars.portCamera = GlobalVars.config.portCamera()
GlobalVars.idCamera = GlobalVars.config.idCamera() GlobalVars.idUrlCamera = GlobalVars.config.idUrlCamera()
GlobalVars.endUrlCamera = GlobalVars.config.endUrlCamera() GlobalVars.endUrlCamera = GlobalVars.config.endUrlCamera()
GlobalVars.ipServ = GlobalVars.config.ipServ() GlobalVars.ipServ = GlobalVars.config.ipServ()
GlobalVars.portServ = GlobalVars.config.portServ() GlobalVars.portServ = GlobalVars.config.portServ()
@ -266,10 +267,10 @@ if __name__ == "__main__":
raise ConfigError("Failed Load IP Camera Configuration") raise ConfigError("Failed Load IP Camera Configuration")
if GlobalVars.portCamera == "error" : if GlobalVars.portCamera == "error" :
raise ConfigError("Failed Load Port Camera Configuration") raise ConfigError("Failed Load Port Camera Configuration")
if GlobalVars.idCamera == "error" : if GlobalVars.idUrlCamera == "error" :
raise ConfigError("Failed Load ID Camera Configuration") raise ConfigError("Failed Load ID Camera Configuration")
if GlobalVars.endUrlCamera == "error" : if GlobalVars.endUrlCamera == "error" :
raise ConfigError("Failed Load ID Camera Configuration") raise ConfigError("Failed Load End Url Camera Configuration")
if GlobalVars.ipServ == "error" : if GlobalVars.ipServ == "error" :
raise ConfigError("Failed Load IP Server Configuration") raise ConfigError("Failed Load IP Server Configuration")
if GlobalVars.portServ == "error" : if GlobalVars.portServ == "error" :
@ -290,7 +291,7 @@ if __name__ == "__main__":
print "" print ""
GlobalVars.urlSocket = 'ws://'+GlobalVars.ipServ+':'+GlobalVars.portCamera+'/socket' GlobalVars.urlSocket = 'ws://'+GlobalVars.ipServ+':'+GlobalVars.portCamera+'/socket'
GlobalVars.urlCamera = 'http://'+GlobalVars.idCamera+'@'+GlobalVars.ipCamera+':'+GlobalVars.portCamera+'/'+GlobalVars.endUrlCamera GlobalVars.urlCamera = 'http://'+GlobalVars.idUrlCamera+'@'+GlobalVars.ipCamera+':'+GlobalVars.portCamera+'/'+GlobalVars.endUrlCamera
GlobalVars.log.printL("->Ping camera ...",lvl.INFO) GlobalVars.log.printL("->Ping camera ...",lvl.INFO)
try : try :