def _s3_render_path(args):
    client, bucket, path, view = args
    if not client:
        client = Client()

    if not bucket:
        bucket = _get_bucket()

    # Render the view
    resp = client.get(path)
    if resp.status_code != 200:
        raise Exception

    # Default to "index.html" as the upload path if we're in a dir listing.
    outpath = path
    if path.endswith("/"):
        outpath += "index.html"

    key = bucket.get_key(outpath) or bucket.new_key(outpath)
    key.content_type = resp['Content-Type']

    temp_file = cStringIO.StringIO(resp.content)
    md5 = key.compute_md5(temp_file)

    # If key is new, there's no etag yet
    if not key.etag:
        _upload_to_s3(key, temp_file)
        message = "Creating"

    else:
        etag = key.etag or ''
        # for some weird reason, etags are quoted, strip them
        etag = etag.strip('"').strip("'")
        if etag not in md5:
            _upload_to_s3(key, temp_file)
            message = "Updating"
        else:
            message = "Skipping"

    print("%s http://%s%s" % (
        message,
        bucket.get_website_endpoint(),
        path
    ))
    temp_file.close()
    return [path, outpath]
dataset/ETHPy150Open mtigas/django-medusa/django_medusa/renderers/s3.py/_s3_render_path/original