modifié: m/fichier/conf

modifié:         m/loadConf.py
	modifié:         superTornado.py
This commit is contained in:
sidya82 2014-03-02 23:47:33 +01:00
parent 3f6c1652f8
commit 951bf0fdb4
3 changed files with 24 additions and 14 deletions

View File

@ -1,3 +1,5 @@
blind=1
camera=192.168.1.13 camera=192.168.1.13
port=80
portServ=80

View File

@ -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'

View File

@ -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 :