modifié: m/loadConf.py

modifié:         superTornado.py
This commit is contained in:
sidya82 2014-03-03 00:34:30 +01:00
parent c0846bff5e
commit 05df02af03
2 changed files with 13 additions and 6 deletions

View File

@ -27,7 +27,11 @@ class LoadConf(object):
def portServ(self) :
return self.loadValue("portServ")
class ConfigError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class bcolors:
HEADER = '\033[95m'
@ -44,3 +48,5 @@ class bcolors:
self.WARNING = ''
self.FAIL = ''
self.ENDC = ''

View File

@ -161,15 +161,16 @@ if __name__ == "__main__":
portCamera = config.portCamera()
portServ = config.portServ()
if blind == "error" :
raise BlindERROR("l")
raise ConfigError("Failed Load Blind Configuration")
if ipCamera == "error" :
raise IPCameraERROR("b")
raise ConfigError("Failed Load IP Camera Configuration")
if portCamera == "error" :
raise PortCamERROR("c")
raise ConfigError("Failed Load IP Camera Configuration")
if portServ == "error" :
raise PortServERROR("e")
except PortServERROR as e :
raise ConfigError("Failed Load Port Server Configuration")
except ConfigError as e :
print bcolors.FAIL
print e
print "Configuration Loading Failed ! Check Configuration File !" + bcolors.ENDC
sys.exit(1)
print "->Configuration Server Load Successfully :"