Display an OK or FAILED message for the context block.

def display_status():
    """Display an OK or FAILED message for the context block."""
    def print_status(msg, color):
        """Print the status message.

        Args:
            msg: The message to display (e.g. OK or FAILED).
            color: The ANSI color code to use in displaying the message.
        """
        print('\r' if sys.stdout.isatty() else '\t', end='')
        print('{}{}[{color}{msg}{}]{}'.format(
            Cursor.FORWARD(_ncols() - 8),
            Style.BRIGHT,
            Fore.RESET,
            Style.RESET_ALL,
            color=color,
            msg=msg[:6].upper().center(6)
        ))
        sys.stdout.flush()

    try:
        yield
    except Status as e:
        _LOGGER.debug(e)
        print_status(e.msg, e.color)
        if e.exc:
            raise e.exc  # pylint: disable=raising-bad-type
    except (KeyboardInterrupt, EOFError):
        raise
    except Exception:
        print_status('FAILED', Fore.RED)
        raise
    else:
        print_status('OK', Fore.GREEN)