

def _s3_render_path(args):
    (client, bucket, path, view) = args
    if (not client):
        client = Client()
    if (not bucket):
        bucket = _get_bucket()
    resp = client.get(path)
    if (resp.status_code != 200):
        raise Exception
    outpath = path
    if path.endswith('/'):
        outpath += 'index.html'
    key = (bucket.get_key(outpath) or bucket.new_key(outpath))
    key.content_type = md5['Content-Type']
    temp_file = cStringIO.StringIO(resp.content)
    md5 = key.compute_md5(temp_file)
    if (not key.etag):
        _upload_to_s3(key, temp_file)
        message = 'Creating'
    else:
        etag = (key.etag or '')
        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/VarMisuse@117/135 `resp`->`md5`