Example #1
0
File: orch.py Project: CGenie/solar
def report(uid):
    colors = {
        'PENDING': 'cyan',
        'ERROR': 'red',
        'SUCCESS': 'green',
        'INPROGRESS': 'yellow',
        'SKIPPED': 'blue'}

    report = graph.report_topo(uid)
    for item in report:
        msg = '{} -> {}'.format(item[0], item[1])
        if item[2]:
            msg += ' :: {}'.format(item[2])
        click.echo(click.style(msg, fg=colors[item[1]]))
Example #2
0
def report(uid):
    colors = {
        'PENDING': 'cyan',
        'ERROR': 'red',
        'SUCCESS': 'green',
        'INPROGRESS': 'yellow',
        'SKIPPED': 'blue'}

    total = 0.0
    report = graph.report_topo(uid)
    for item in report:
        msg = '{} -> {}'.format(item[0], item[1])
        if item[2]:
            msg += ' :: {}'.format(item[2])
        if item[4] and item[3]:
            delta = float(item[4])-float(item[3])
            total += delta
            msg += ' D: {}'.format(delta)
        click.echo(click.style(msg, fg=colors[item[1]]))
    click.echo('Delta SUM: {}'.format(total))
Example #3
0
def click_report(uid):
    colors = {
        'PENDING': 'cyan',
        'ERROR': 'red',
        'SUCCESS': 'green',
        'INPROGRESS': 'yellow',
        'SKIPPED': 'blue'
    }

    total = 0.0
    report = graph.report_topo(uid)
    for item in report:
        msg = '{} -> {}'.format(item[0], item[1])
        if item[2]:
            msg += ' :: {}'.format(item[2])
        if item[4] and item[3]:
            delta = float(item[4]) - float(item[3])
            total += delta
            msg += ' D: {}'.format(delta)
        click.echo(click.style(msg, fg=colors[item[1]]))
    click.echo('Delta SUM: {}'.format(total))
Example #4
0
def click_report(uid):
    colors = {
        "PENDING": "cyan",
        "ERROR": "red",
        "SUCCESS": "green",
        "INPROGRESS": "yellow",
        "SKIPPED": "blue",
        "NOOP": "black",
    }

    total = 0.0
    report = graph.report_topo(uid)
    for item in report:
        msg = "{} -> {}".format(item[0], item[1])
        if item[2]:
            msg += " :: {}".format(item[2])
        if item[4] and item[3]:
            delta = float(item[4]) - float(item[3])
            total += delta
            msg += " D: {}".format(delta)
        click.echo(click.style(msg, fg=colors[item[1]]))
    click.echo("Delta SUM: {}".format(total))