示例#1
0
文件: colors.py 项目: enigma/watson
def fail(string, terminate=True):
    """Wraps a string in the terminal colors for fail.

    Usage:
        fail('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, FAIL, TERMINATE if terminate else '')
示例#2
0
文件: colors.py 项目: enigma/watson
def ok_blue(string, terminate=True):
    """Wraps a string in the terminal colors for ok blue.

    Usage:
        ok_blue('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, OK_BLUE, TERMINATE if terminate else '')
示例#3
0
文件: colors.py 项目: enigma/watson
def warning(string, terminate=True):
    """Wraps a string in the terminal colors for warning.

    Usage:
        warning('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, WARNING, TERMINATE if terminate else '')
示例#4
0
def fail(string, terminate=True):
    """Wraps a string in the terminal colors for fail.

    Usage:
        fail('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, FAIL, TERMINATE if terminate else '')
示例#5
0
文件: colors.py 项目: enigma/watson
def header(string, terminate=True):
    """Wraps a string in the terminal colors for headers.

    Usage:
        header('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, HEADER, TERMINATE if terminate else '')
示例#6
0
def warning(string, terminate=True):
    """Wraps a string in the terminal colors for warning.

    Usage:
        warning('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, WARNING, TERMINATE if terminate else '')
示例#7
0
def ok_blue(string, terminate=True):
    """Wraps a string in the terminal colors for ok blue.

    Usage:
        ok_blue('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, OK_BLUE, TERMINATE if terminate else '')
示例#8
0
def header(string, terminate=True):
    """Wraps a string in the terminal colors for headers.

    Usage:
        header('some text')  # colored text in terminal

    Args:
        string string: The string to wrap
        boolean terminate: Whether or not to terminate the color
    """
    return format_style(string, HEADER, TERMINATE if terminate else '')
示例#9
0
def fail(string, terminate=True):
    """Wraps a string in the terminal colors for fail.

    Example:

    .. code-block:: python

        fail('some text')  # colored text in terminal

    Args:
        string (string): The string to wrap
        terminate (boolean): Whether or not to terminate the color
    """
    return format_style(string, FAIL, TERMINATE if terminate else '')
示例#10
0
def ok_green(string, terminate=True):
    """Wraps a string in the terminal colors for ok green.

    Example:

    .. code-block:: python

        ok_green('some text')  # colored text in terminal

    Args:
        string (string): The string to wrap
        terminate (boolean): Whether or not to terminate the color
    """
    return format_style(string, OK_GREEN, TERMINATE if terminate else '')