Пример #1
0
def debug_param(msg, value, padding=30):
    """
    helper method to debug parameter values, with alignment

    :param str msg: the message
    :param Object value: the value
    :param int padding: padding for the message
    """
    fmt = '{0: <' + str(padding) + '} : {1}'
    debug(fmt.format(msg, click.style(str(value), fg=get_color('debug'))))
Пример #2
0
def echo_target(msg, verbose=True):
    """
    convenience method to display a message using the **blue** ANSI color,
    the method relies on :func:`click.secho`

    :param str msg: the message
    :param bool verbose: echo message only if True
    """
    if verbose:
        click.secho(msg, fg=get_color('target'))
Пример #3
0
def debug_param(msg, value, padding=30):
    """
    helper method to debug parameter values, with alignment

    :param str msg: the message
    :param Object value: the value
    :param int padding: padding for the message
    """
    fmt = '{0: <' + str(padding) + '} : {1}'
    debug(fmt.format(msg, click.style(str(value), fg=get_color('debug'))))
Пример #4
0
def echo_target(msg, verbose=True):
    """
    convenience method to display a message using the **blue** ANSI color,
    the method relies on :func:`click.secho`

    :param str msg: the message
    :param bool verbose: echo message only if True
    """
    if verbose:
        click.secho(msg, fg=get_color('target'))
Пример #5
0
def echo_success(msg, verbose=True, nl=True):
    """
    convenience method to display a message using the **green** ANSI color,
    the method relies on :func:`click.secho`

    :param str msg: the message
    :param bool verbose: echo message only if True
    :param bool nl: print new line
    """
    if verbose:
        click.secho(msg, fg=get_color('success'), nl=nl)
Пример #6
0
def echo_success(msg, verbose=True, nl=True):
    """
    convenience method to display a message using the **green** ANSI color,
    the method relies on :func:`click.secho`

    :param str msg: the message
    :param bool verbose: echo message only if True
    :param bool nl: print new line
    """
    if verbose:
        click.secho(msg, fg=get_color('success'), nl=nl)