mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Merge branch 'master' of github.com:sqlmapproject/sqlmap
This commit is contained in:
@@ -742,7 +742,7 @@ def setColor(message, bold=False):
|
||||
|
||||
return retVal
|
||||
|
||||
def dataToStdout(data, forceOutput=False, bold=False):
|
||||
def dataToStdout(data, forceOutput=False, bold=False, content_type=None, status=None):
|
||||
"""
|
||||
Writes text to the stdout (console) stream
|
||||
"""
|
||||
@@ -754,8 +754,15 @@ def dataToStdout(data, forceOutput=False, bold=False):
|
||||
if kb.get("multiThreadMode"):
|
||||
logging._acquireLock()
|
||||
|
||||
message = stdoutencode(data)
|
||||
sys.stdout.write(setColor(message, bold))
|
||||
if isinstance(data, basestring):
|
||||
message = stdoutencode(data)
|
||||
else:
|
||||
message = data
|
||||
|
||||
if hasattr(conf, "api"):
|
||||
sys.stdout.write(message, status=status, content_type=content_type)
|
||||
else:
|
||||
sys.stdout.write(setColor(message, bold))
|
||||
|
||||
try:
|
||||
sys.stdout.flush()
|
||||
|
||||
Reference in New Issue
Block a user