Exemplo n.º 1
0
def head(url):
    _setup_s3_connection()

    bucket, key = _split_url(url)
    s3_bucket = s3.get_bucket(bucket, validate=False)
    if s3_bucket and s3_bucket.get_key(key):
        return True
    return False
Exemplo n.º 2
0
def head(url):
    _setup_s3_connection()

    bucket, key = _split_url(url)
    s3_bucket = s3.get_bucket(bucket, validate=False)
    if s3_bucket and s3_bucket.get_key(key):
        return True
    return False
Exemplo n.º 3
0
def list(url):
    _setup_s3_connection()

    bucket, key = _split_url(url)
    if not bucket:
        return [bucket.name.encode('utf-8') for bucket in s3.get_all_buckets()]
    else:
        bucket = s3.get_bucket(bucket, validate=False)
        return [('s3://%s/%s' % (key.bucket.name, key.name)).encode('utf-8')
                for key in bucket.get_all_keys(prefix=key)]
Exemplo n.º 4
0
def list(url):
    _setup_s3_connection()

    bucket, key = _split_url(url)
    if not bucket:
        return [ bucket.name.encode('utf-8')
                for bucket in s3.get_all_buckets() ]
    else:
        bucket = s3.get_bucket(bucket, validate=False)
        return [ ('s3://%s/%s' % (key.bucket.name, key.name)).encode('utf-8')
                for key in bucket.get_all_keys(prefix=key) ]
Exemplo n.º 5
0
def _get_key(url):
    bucket, key = _split_url(url)
    return s3.get_bucket(bucket, validate=False).new_key(key)
Exemplo n.º 6
0
def _get_key(url):
    bucket, key = _split_url(url)
    return s3.get_bucket(bucket, validate=False).new_key(key)