modifié: m/fichier/conf
modifié: m/loadConf.py modifié: superTornado.py
This commit is contained in:
parent
3f6c1652f8
commit
951bf0fdb4
@ -1,3 +1,5 @@
|
|||||||
|
blind=1
|
||||||
camera=192.168.1.13
|
camera=192.168.1.13
|
||||||
port=80
|
|
||||||
|
portServ=80
|
||||||
|
|
||||||
|
@ -21,8 +21,13 @@ class LoadConf(object):
|
|||||||
def ipCamera(self) :
|
def ipCamera(self) :
|
||||||
return self.loadValue("camera")
|
return self.loadValue("camera")
|
||||||
|
|
||||||
|
def portCamera(self) :
|
||||||
|
return self.loadValue("portCamera")
|
||||||
|
|
||||||
def portServ(self) :
|
def portServ(self) :
|
||||||
return self.loadValue("port")
|
return self.loadValue("portServ")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class bcolors:
|
class bcolors:
|
||||||
HEADER = '\033[95m'
|
HEADER = '\033[95m'
|
||||||
|
@ -156,25 +156,28 @@ if __name__ == "__main__":
|
|||||||
print "->Loading configuration ... "
|
print "->Loading configuration ... "
|
||||||
try :
|
try :
|
||||||
blind = config.isBlind()
|
blind = config.isBlind()
|
||||||
camera = config.ipCamera()
|
ipCamera = config.ipCamera()
|
||||||
port = config.portServ()
|
portCamera = config.portCamera())
|
||||||
|
portServ = config.portServ()
|
||||||
if blind == "error" :
|
if blind == "error" :
|
||||||
raise "Failed Load Blind Configuration"
|
raise BlindConfigurationERROR(bcolors.FAIL +"Failed Load Blind Configuration")
|
||||||
if camera == "error" :
|
if ipCamera == "error" :
|
||||||
raise "Failed Load IP Camera Configuration"
|
raise IPCameraConfigurationERROR(bcolors.FAIL +"Failed Load IP Camera Configuration"
|
||||||
if port == "error" :
|
if portCamera == "error" :
|
||||||
raise "Failed Load Port Server Configuration"
|
raise PortCameraConfigurationERROR(bcolors.FAIL + "Failed Load IP Camera Configuration"
|
||||||
|
if portServ == "error" :
|
||||||
|
raise PortServ ConfigurationERROR(bcolors.FAIL + "Failed Load Port Server Configuration"
|
||||||
except Exception, e :
|
except Exception, e :
|
||||||
print bcolors.WARNING + "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC
|
print "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC
|
||||||
print e
|
print bcolors.FAIL + e + bcolors.ENDC
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print "->Configuration Server Load Successfully :"
|
print "->Configuration Server Load Successfully :"
|
||||||
if blind == True:
|
if blind == True:
|
||||||
print " ->Blind unhabitant"
|
print " ->Blind unhabitant"
|
||||||
else :
|
else :
|
||||||
print " ->Not blind unhabitant"
|
print " ->Not blind unhabitant"
|
||||||
print " ->Ip camera : " + camera
|
print " ->Ip camera : " + ipCamera
|
||||||
print " ->Port Server : " + port
|
print " ->Port Server : " + portServ
|
||||||
tornado.options.parse_command_line()
|
tornado.options.parse_command_line()
|
||||||
|
|
||||||
try :
|
try :
|
||||||
|
Reference in New Issue
Block a user