modifié: superTornado.py

This commit is contained in:
sidya82 2014-03-03 00:13:47 +01:00
parent a89b3ad53d
commit ff52f8a029

View File

@ -21,8 +21,9 @@ import os
config = LoadConf() config = LoadConf()
blind = False blind = False
camera = "" ipCamera = ""
port ="" portCamera = ""
portServ =""
ficLog = Log() ficLog = Log()
@ -156,9 +157,18 @@ if __name__ == "__main__":
print "->Loading configuration ... " print "->Loading configuration ... "
try : try :
blind = config.isBlind() blind = config.isBlind()
ipCamera = config.ipCamera()
portCamera = config.portCamera()
portServ = config.portServ()
if blind == "error" : if blind == "error" :
raise BlindConfigurationERROR("Failed Load Blind Configuration") raise BlindConfigurationERROR("l")
except BlindConfigurationERROR as e : if ipCamera == "error" :
raise IPCameraConfigurationERROR("b")
if portCamera == "error" :
raise PortCameraConfigurationERROR("c")
if portServ == "error" :
raise PortServConfigurationERROR("e")
except Exception as e :
print bcolors.FAIL print bcolors.FAIL
print e print e
print "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC print "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC
@ -168,13 +178,14 @@ if __name__ == "__main__":
print " ->Blind unhabitant" print " ->Blind unhabitant"
else : else :
print " ->Not blind unhabitant" print " ->Not blind unhabitant"
print " ->Ip camera : " + ipCamera
print " ->Port Server : " + portServ
tornado.options.parse_command_line() tornado.options.parse_command_line()
try : try :
print("->Server Start ...") print("->Server Start ...")
http_server = tornado.httpserver.HTTPServer(application) http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(80) http_server.listen(portServ)
print "->Server Start Successfully !" print "->Server Start Successfully !"
tornado.ioloop.IOLoop.instance().start() tornado.ioloop.IOLoop.instance().start()
except Exception, e : except Exception, e :