コード例 #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
ファイル: colors.py プロジェクト: B-Rich/watson-console
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
ファイル: colors.py プロジェクト: B-Rich/watson-console
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 '')