How to use the peru.compat.is_fancy_terminal function in peru

To help you get started, we’ve selected a few peru examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buildinspace / peru / peru / main.py View on Github external
def print_red(*args, **kwargs):
    if compat.is_fancy_terminal():
        sys.stdout.write('\x1b[31m')
    print(*args, **kwargs)
    if compat.is_fancy_terminal():
        sys.stdout.write('\x1b[39m')
github buildinspace / peru / peru / runtime.py View on Github external
def get_display(args):
    if args['--quiet']:
        return display.QuietDisplay()
    elif args['--verbose']:
        return display.VerboseDisplay()
    elif compat.is_fancy_terminal():
        return display.FancyDisplay()
    else:
        return display.QuietDisplay()
github buildinspace / peru / peru / main.py View on Github external
def print_red(*args, **kwargs):
    if compat.is_fancy_terminal():
        sys.stdout.write('\x1b[31m')
    print(*args, **kwargs)
    if compat.is_fancy_terminal():
        sys.stdout.write('\x1b[39m')