

def _print_phantomjs_output(result):
    errors = result['errors']
    messages = result['messages']
    resources = result['resources']
    for message in messages:
        msg = message['msg']
        line = message.get('line')
        source = message.get('source')
        if (source is None):
            write(msg)
        elif (line is None):
            write(('%s: %s' % (source, msg)))
        else:
            write(('%s:%s: %s' % (source, line, msg)))
    for resource in resources:
        url = resource['url']
        if url.endswith('.png'):
            ok(('%s: %s (%s)' % (url, yellow(resource['status']), resource['statusText'])))
        else:
            warn(('Resource error:: %s: %s (%s)' % (url, red(resource['status']), resource['statusText'])))
    for error in errors:
        warn(('%s: %s' % (red('PhatomJS Error: '), error['msg'])))
        for item in error['trace']:
            write(('    %s: %d' % (item['file'], item['line'])))

dataset/ETHPy150Open bokeh/bokeh/tests/examples/test_examples.py _print_phantomjs_output/original