From eea71d3b78022bf2b3c4445f5f01186b4d0703da Mon Sep 17 00:00:00 2001 From: sidya82 Date: Sun, 2 Mar 2014 23:20:31 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20m/fi?= =?UTF-8?q?chier/conf=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20superTo?= =?UTF-8?q?rnado.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- m/fichier/conf | 2 +- superTornado.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/m/fichier/conf b/m/fichier/conf index ab8214d..8f36451 100644 --- a/m/fichier/conf +++ b/m/fichier/conf @@ -1,3 +1,3 @@ blind=1 -camera=192 +camera=192.168.1.13 port=80 diff --git a/superTornado.py b/superTornado.py index 5e12164..51ebbf2 100644 --- a/superTornado.py +++ b/superTornado.py @@ -20,8 +20,12 @@ import os config = LoadConf() +blind = False +cam = "" +port ="" ficLog = Log() + class BaseHandler(tornado.web.RequestHandler): def get_current_user(self): return self.get_secure_cookie("user") @@ -151,26 +155,26 @@ application = tornado.web.Application([ if __name__ == "__main__": print "->Loading configuration ... " try : - confAveug = config.isBlind - ipCamera = config.ipCamera - portServ = config.portServ - if confAveug == "error" : + blind = config.isBlind + cam = config.ipCamera + port = config.portServ + if blind == "error" : raise "Failed Load Blind Configuration" - if ipCamera == "error" : + if cam == "error" : raise "Failed Load IP Camera Configuration" - if portServ == "error" : + if port == "error" : raise "Failed Load Port Server Configuration" except Exception, e : print "Configuration Loading Failed ! Check Configuration File !" print e sys.exit(1) print "->Configuration Server Load Successfully:" - if confAveug == True: + if blind == True: print " ->Blind unhabitant" else : print " ->Not blind unhabitant" - print " ->Ip camera : " + ipCamera - print " ->Port Server : " + portServ + print " ->Ip camera : " + cam + print " ->Port Server : " + port tornado.options.parse_command_line() http_server = tornado.httpserver.HTTPServer(application)