modifié: m/fichier/conf
modifié: m/loadConf.py modifié: superTornado.py
This commit is contained in:
parent
34d8a7c6b3
commit
dba3859ba8
@ -1,5 +1,8 @@
|
||||
blind=1
|
||||
camera=192.168.1.13
|
||||
portCamera=80
|
||||
idCamera=test:a
|
||||
endUrlCamera=image.jpg?cidx=791836195
|
||||
serv=192.168.1.12
|
||||
portServ=80
|
||||
|
||||
|
@ -55,6 +55,22 @@ class LoadConf(object):
|
||||
def portServ(self) :
|
||||
return self.loadValue("portServ")
|
||||
|
||||
"""
|
||||
Return idCamera configuration
|
||||
Else "error"
|
||||
"""
|
||||
def idCamera(self) :
|
||||
return self.loadValue("idCamera")
|
||||
|
||||
"""
|
||||
Return endUrlCamera configuration
|
||||
Else "error"
|
||||
"""
|
||||
def endUrlCamera(self) :
|
||||
return self.loadValue("endUrlCamera")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ConfigError(Exception):
|
||||
|
@ -30,9 +30,11 @@ class GlobalVars :
|
||||
blind = False
|
||||
ipCamera = ""
|
||||
portCamera = ""
|
||||
endUrlCamera = ""
|
||||
idCamera = ""
|
||||
urlCamera = ""
|
||||
portServ = ""
|
||||
log = Log()
|
||||
urlCamera = ""
|
||||
urlSocket = ""
|
||||
authorized = 0
|
||||
unauthorized = 0
|
||||
@ -253,14 +255,21 @@ if __name__ == "__main__":
|
||||
GlobalVars.blind = config.isBlind()
|
||||
GlobalVars.ipCamera = config.ipCamera()
|
||||
GlobalVars.portCamera = config.portCamera()
|
||||
GlobalVars.idCamera = config.idCamera()
|
||||
GlobalVars.endUrlCamera = config.endUrlCamera()
|
||||
GlobalVars.ipServ = config.ipServ()
|
||||
GlobalVars.portServ = config.portServ()
|
||||
|
||||
if blind == "error" :
|
||||
raise ConfigError("Failed Load Blind Configuration")
|
||||
if ipCamera == "error" :
|
||||
raise ConfigError("Failed Load IP Camera Configuration")
|
||||
if portCamera == "error" :
|
||||
raise ConfigError("Failed Load Port Camera Configuration")
|
||||
if idCamera == "error" :
|
||||
raise ConfigError("Failed Load ID Camera Configuration")
|
||||
if endUrlCamera == "error" :
|
||||
raise ConfigError("Failed Load ID Camera Configuration")
|
||||
if ipServ == "error" :
|
||||
raise ConfigError("Failed Load IP Server Configuration")
|
||||
if portServ == "error" :
|
||||
@ -281,7 +290,7 @@ if __name__ == "__main__":
|
||||
print ""
|
||||
|
||||
GlobalVars.urlSocket = 'ws://'+GlobalVars.ipServ+':'+GlobalVars.portCamera+'/socket'
|
||||
GlobalVars.urlCamera = 'http://test:a@'+GlobalVars.ipCamera+':'+GlobalVars.portCamera+'/image.jpg?cidx=791836195'
|
||||
GlobalVars.urlCamera = 'http://'+GlobalVars.idCamera+'@'+GlobalVars.ipCamera+':'+GlobalVars.portCamera+'/'+GlobalVars.endUrlCamera
|
||||
|
||||
log.printL("->Ping camera ...",lvl.INFO)
|
||||
try :
|
||||
|
Reference in New Issue
Block a user