X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=python%2Fcumulus%2Fstore%2Fs3.py;h=65884ea5465e956738c0cae736176575b6e38c7e;hp=63efa17d5d7b748a55f4aede245147e234350f6c;hb=65edb87a0b8a578b4a7221478a851d71df21fab0;hpb=fe6bbd9d0b49d6b6e43451f7703894ab02aee73e diff --git a/python/cumulus/store/s3.py b/python/cumulus/store/s3.py index 63efa17..65884ea 100644 --- a/python/cumulus/store/s3.py +++ b/python/cumulus/store/s3.py @@ -6,11 +6,11 @@ from boto.s3.key import Key import cumulus.store class S3Store(cumulus.store.Store): - def __init__(self, bucket, prefix): + def __init__(self, url, **kw): + (bucket, prefix) = self.path.lstrip("/").split("/", 1) self.conn = boto.connect_s3(is_secure=False) self.bucket = self.conn.create_bucket(bucket) - while prefix.endswith("/"): prefix = prefix[:-1] - self.prefix = prefix + self.prefix = prefix.rstrip ("/") self.scan_cache = {} def _get_key(self, type, name): @@ -54,3 +54,5 @@ class S3Store(cumulus.store.Store): raise cumulus.store.NotFoundError return {'size': int(k.size)} + +Store = S3Store