dhunter/core/log.py
def substitute_ansi(message):
        """Replaces color code placeholder with ANSI values.

        Args:
          message: message to process

        Returns:
          message with placeholders replaced with ANSI codes
        """
        color_map = {
            'reset': Log.ANSI_RESET,
            'reverse': Log.ANSI_REVERSE,

            'black': Log.ANSI_BLACK,
            'black_bright': Log.ANSI_BLACK_BRIGHT,
            'red': Log.ANSI_RED,
            'green': Log.ANSI_GREEN,
            'green_bright': Log.ANSI_GREEN_BRIGHT,
            'yellow': Log.ANSI_YELLOW,
            'yellow_bright': Log.ANSI_YELLOW_BRIGHT,
            'blue': Log.ANSI_BLUE,
            'magenta': Log.ANSI_MAGENTA,
            'cyan': Log.ANSI_CYAN,
            'white': Log.ANSI_WHITE,

            'error': Log.ANSI_RED,
            'warn': Log.ANSI_YELLOW,
            'notice': Log.ANSI_CYAN,
            'info': None,
            'ok': Log.ANSI_GREEN,
            'debug': Log.ANSI_REVERSE,
            'banner': (Log.ANSI_WHITE + Log.ANSI_REVERSE),
        }

        for (key, color) in color_map.items():
            message = re.sub('%{key}%'.format(key=key), color if color is not None else '', message)

        return message
Replaces color code placeholder with ANSI values.

        Args:
          message: message to process

        Returns:
          message with placeholders replaced with ANSI codes
        
Replaces color code placeholder with ANSI values.
Replaces color code placeholder with ANSI values .
def substitute_ansi(message):
        color_map = {
            'reset': Log.ANSI_RESET,
            'reverse': Log.ANSI_REVERSE,
            'black': Log.ANSI_BLACK,
            'black_bright': Log.ANSI_BLACK_BRIGHT,
            'red': Log.ANSI_RED,
            'green': Log.ANSI_GREEN,
            'green_bright': Log.ANSI_GREEN_BRIGHT,
            'yellow': Log.ANSI_YELLOW,
            'yellow_bright': Log.ANSI_YELLOW_BRIGHT,
            'blue': Log.ANSI_BLUE,
            'magenta': Log.ANSI_MAGENTA,
            'cyan': Log.ANSI_CYAN,
            'white': Log.ANSI_WHITE,
            'error': Log.ANSI_RED,
            'warn': Log.ANSI_YELLOW,
            'notice': Log.ANSI_CYAN,
            'info': None,
            'ok': Log.ANSI_GREEN,
            'debug': Log.ANSI_REVERSE,
            'banner': (Log.ANSI_WHITE + Log.ANSI_REVERSE),
        }
        for (key, color) in color_map.items():
            message = re.sub('%{key}%'.format(key=key), color if color is not None else '', message)
        return message
def substitute_ansi ( message ) : color_map = { 'reset' : Log . ANSI_RESET , 'reverse' : Log . ANSI_REVERSE , 'black' : Log . ANSI_BLACK , 'black_bright' : Log . ANSI_BLACK_BRIGHT , 'red' : Log . ANSI_RED , 'green' : Log . ANSI_GREEN , 'green_bright' : Log . ANSI_GREEN_BRIGHT , 'yellow' : Log . ANSI_YELLOW , 'yellow_bright' : Log . ANSI_YELLOW_BRIGHT , 'blue' : Log . ANSI_BLUE , 'magenta' : Log . ANSI_MAGENTA , 'cyan' : Log . ANSI_CYAN , 'white' : Log . ANSI_WHITE , 'error' : Log . ANSI_RED , 'warn' : Log . ANSI_YELLOW , 'notice' : Log . ANSI_CYAN , 'info' : None , 'ok' : Log . ANSI_GREEN , 'debug' : Log . ANSI_REVERSE , 'banner' : ( Log . ANSI_WHITE + Log . ANSI_REVERSE ) , } for ( key , color ) in color_map . items ( ) : message = re . sub ( '%{key}%' . format ( key = key ) , color if color is not None else '' , message ) return message
Replaces color code placeholder with ANSI values.
Replaces color code placeholder with ANSI values .
"""Replaces color code placeholder with ANSI values.

        Args:
          message: message to process

        Returns:
          message with placeholders replaced with ANSI codes
        """
message with placeholders replaced with ANSI codes
message with placeholders replaced with ANSI codes
message
message to process
message to process