modifié: m/log.py

modifié:         m/login.py
	modifié:         superTornado.py
This commit is contained in:
sidya82 2014-03-03 13:55:30 +01:00
parent baeec52526
commit e29fb0bc79
3 changed files with 12 additions and 12 deletions

View File

@ -31,17 +31,17 @@ class Log(object):
def printL(self,pMsg,pLvl): def printL(self,pMsg,pLvl):
self.logger.log(pLvl,pMsg) self.logger.log(pLvl,pMsg)
if pLvl == 10 : if pLvl == 10 :
print bcolors.DEBUG, print bcolors.DEBUG
elif pLvl == 20 : elif pLvl == 20 :
print bcolors.INFO, print bcolors.INFO
elif pLvl == 25 : elif pLvl == 25 :
print bcolors.SUCCESS, print bcolors.SUCCESS
elif pLvl == 30 : elif pLvl == 30 :
print bcolors.WARNING, print bcolors.WARNING
elif pLvl == 40 : elif pLvl == 40 :
print bcolors.FAIL, print bcolors.FAIL
print pMsg print pMsg
print bcolors.ENDC, print bcolors.ENDC
class bcolors: class bcolors:
DEBUG = '\033[94m' DEBUG = '\033[94m'

View File

@ -8,7 +8,7 @@ class Login(object):
with open("m/fichier/autorise", "r") as source : with open("m/fichier/autorise", "r") as source :
for ligne in source : for ligne in source :
data = ligne.rstrip('\n\r').split(',') data = ligne.rstrip('\n\r').split(',')
if data[0] in pLog : if data[0] == pLog :
if data[1] in hashMdp : if data[1] in hashMdp :
source.close() source.close()
return True return True

View File

@ -174,12 +174,12 @@ if __name__ == "__main__":
sys.exit(1) sys.exit(1)
print log.printL("->Configuration Server Load Successfully !",25) print log.printL("->Configuration Server Load Successfully !",25)
if blind == True: if blind == True:
log.printL(" ->Blind unhabitant",25) log.printL(" ->Blind unhabitant",20)
else : else :
log.printL(" ->Not blind unhabitant",25) log.printL(" ->Not blind unhabitant",20)
log.printL(" ->Ip camera : " + ipCamera,25) log.printL(" ->Ip camera : " + ipCamera,20)
log.printL(" ->Port Camera : " + portCamera,25) log.printL(" ->Port Camera : " + portCamera,20)
log.printL(" ->Port Server : " + portServ,25) log.printL(" ->Port Server : " + portServ,20)
try : try :
log.printL("->Server Start ...",20) log.printL("->Server Start ...",20)