Errors handling when importing native color scheme

This commit is contained in:
clamsawd 2015-10-31 21:31:52 +01:00
parent 5184ed4d59
commit 0b53361e61

View File

@ -93,24 +93,27 @@ else:
exec(open("ip2e-conf.py").read()) exec(open("ip2e-conf.py").read())
#Import native OS color scheme #Import native OS color scheme
def GreenColor(): try:
if os.name == "posix": def GreenColor():
GreenColor = (chr(27)+"[1;32m") if os.name == "posix":
print (GreenColor+"", end="") GreenColor = (chr(27)+"[1;32m")
elif os.name == "nt": print (GreenColor+"", end="")
os.system("color 2") elif os.name == "nt":
def RedColor(): os.system("color 2")
if os.name == "posix": def RedColor():
RedColor = (chr(27)+"[1;31m") if os.name == "posix":
print (RedColor+"", end="") RedColor = (chr(27)+"[1;31m")
elif os.name == "nt": print (RedColor+"", end="")
os.system("color 4") elif os.name == "nt":
def OrangeColor(): os.system("color 4")
if os.name == "posix": def OrangeColor():
OrangeColor = (chr(27)+"[1;33m") if os.name == "posix":
print (OrangeColor+"", end="") OrangeColor = (chr(27)+"[1;33m")
elif os.name == "nt": print (OrangeColor+"", end="")
os.system("color 6") elif os.name == "nt":
os.system("color 6")
except:
print ("Error importing native color scheme")
#Check if exists a previous log.file. #Check if exists a previous log.file.
if os.path.isfile("ip2e.log"): if os.path.isfile("ip2e.log"):