From 92ae8145df4320cf818ab476d2f0e9a6aa56cec0 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Tue, 29 Jan 2013 15:35:51 +0000 Subject: [PATCH] ignore any non-relevant string: avoid storing to the API, careful this can introduce bugs but it is necessary at this stage of development (issue #297) --- lib/core/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 6b9b1f63f..b554214df 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -760,7 +760,8 @@ def dataToStdout(data, forceOutput=False, bold=False, content_type=None, status= message = data if hasattr(conf, "api"): - sys.stdout.write(message, status=status, content_type=content_type) + if content_type and status: + sys.stdout.write(message, status, content_type) else: sys.stdout.write(setColor(message, bold)) @@ -772,7 +773,7 @@ def dataToStdout(data, forceOutput=False, bold=False, content_type=None, status= if kb.get("multiThreadMode"): logging._releaseLock() - kb.prependFlag = len(data) == 1 and data not in ('\n', '\r') or len(data) > 2 and data[0] == '\r' and data[-1] != '\n' + kb.prependFlag = isinstance(data, basestring) and (len(data) == 1 and data not in ('\n', '\r') or len(data) > 2 and data[0] == '\r' and data[-1] != '\n') def dataToTrafficFile(data): if not conf.trafficFile: