modifié: m/loadConf.py
modifié: superTornado.py
This commit is contained in:
		@@ -27,7 +27,11 @@ class LoadConf(object):
 | 
				
			|||||||
    def portServ(self) :
 | 
					    def portServ(self) :
 | 
				
			||||||
        return self.loadValue("portServ")
 | 
					        return self.loadValue("portServ")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ConfigError(Exception):
 | 
				
			||||||
 | 
					    def __init__(self, value):
 | 
				
			||||||
 | 
					        self.value = value
 | 
				
			||||||
 | 
					    def __str__(self):
 | 
				
			||||||
 | 
					        return repr(self.value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class bcolors:
 | 
					class bcolors:
 | 
				
			||||||
    HEADER = '\033[95m'
 | 
					    HEADER = '\033[95m'
 | 
				
			||||||
@@ -44,3 +48,5 @@ class bcolors:
 | 
				
			|||||||
        self.WARNING = ''
 | 
					        self.WARNING = ''
 | 
				
			||||||
        self.FAIL = ''
 | 
					        self.FAIL = ''
 | 
				
			||||||
        self.ENDC = ''
 | 
					        self.ENDC = ''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -161,15 +161,16 @@ if __name__ == "__main__":
 | 
				
			|||||||
        portCamera = config.portCamera()
 | 
					        portCamera = config.portCamera()
 | 
				
			||||||
        portServ = config.portServ()
 | 
					        portServ = config.portServ()
 | 
				
			||||||
        if blind == "error" :
 | 
					        if blind == "error" :
 | 
				
			||||||
            raise BlindERROR("l")
 | 
					            raise ConfigError("Failed Load Blind Configuration")
 | 
				
			||||||
        if ipCamera == "error" :
 | 
					        if ipCamera == "error" :
 | 
				
			||||||
            raise IPCameraERROR("b")
 | 
					            raise ConfigError("Failed Load IP Camera Configuration")
 | 
				
			||||||
        if portCamera == "error" :
 | 
					        if portCamera == "error" :
 | 
				
			||||||
            raise PortCamERROR("c")
 | 
					            raise ConfigError("Failed Load IP Camera Configuration")
 | 
				
			||||||
        if portServ == "error" :
 | 
					        if portServ == "error" :
 | 
				
			||||||
            raise PortServERROR("e")
 | 
					            raise ConfigError("Failed Load Port Server Configuration")
 | 
				
			||||||
    except PortServERROR as e :
 | 
					    except ConfigError as e :
 | 
				
			||||||
        print bcolors.FAIL
 | 
					        print bcolors.FAIL
 | 
				
			||||||
 | 
					        print e
 | 
				
			||||||
        print "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC
 | 
					        print "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC
 | 
				
			||||||
        sys.exit(1)
 | 
					        sys.exit(1)
 | 
				
			||||||
    print "->Configuration Server Load Successfully :"
 | 
					    print "->Configuration Server Load Successfully :"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user