Where things could go kaboom (changing terminal coloring)

This commit is contained in:
Miroslav Stampar
2018-07-05 14:01:43 +02:00
parent a424e4ab59
commit 57be1856a6
4 changed files with 34 additions and 15 deletions

View File

@@ -884,11 +884,7 @@ def setColor(message, bold=False):
retVal = colored(message, color=None, on_color=None, attrs=("bold",))
elif level:
level = getattr(logging, level, None) if isinstance(level, basestring) else level
_ = LOGGER_HANDLER.level_map.get(level)
if _:
background, foreground, bold = _
retVal = colored(message, color=foreground, on_color="on_%s" % background if background else None, attrs=("bold",) if bold else None)
retVal = LOGGER_HANDLER.colorize(message, level)
kb.stickyLevel = level if message and message[-1] != "\n" else None
return retVal

View File

@@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.2.7.4"
VERSION = "1.2.7.5"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)