Just in case patch (for --api)

This commit is contained in:
Miroslav Stampar
2018-10-03 12:46:40 +02:00
parent 36b660309b
commit eba01ee74e
3 changed files with 5 additions and 5 deletions

View File

@@ -899,7 +899,7 @@ def clearColors(message):
retVal = message
if message:
if isinstance(message, str):
retVal = re.sub(r"\x1b\[[\d;]+m", "", message)
return retVal
@@ -923,7 +923,7 @@ def dataToStdout(data, forceOutput=False, bold=False, content_type=None, status=
try:
if conf.get("api"):
sys.stdout.write(message, status, content_type)
sys.stdout.write(clearColors(message), status, content_type)
else:
sys.stdout.write(setColor(message, bold=bold))