Bug 8208 - bare metal provisioning

Add color to print text of python script
This commit is contained in:
Frank 2011-04-12 17:37:46 -07:00
parent 916117a319
commit 50b6aca738

View File

@ -95,13 +95,13 @@ def initLoging(logFile=None):
except:
logging.basicConfig(level=logging.DEBUG)
def writeProgressBar(msg, result=None):
def writeProgressBar(msg, result=None):
if msg is not None:
output = "%-80s"%msg
elif result is True:
output = "[%-2s]\n"%"OK"
output = "[ \033[92m%-2s\033[0m ]\n"%"OK"
elif result is False:
output = "[%-6s]\n"%"Failed"
output = "[ \033[91m%-6s\033[0m ]\n"%"FAILED"
sys.stdout.write(output)
sys.stdout.flush()