projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement FTP backend and other code cleanups.
[cumulus.git]
/
python
/
cumulus
/
store
/
s3.py
diff --git
a/python/cumulus/store/s3.py
b/python/cumulus/store/s3.py
index
63efa17
..
65884ea
100644
(file)
--- 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):
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)
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):
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)}
raise cumulus.store.NotFoundError
return {'size': int(k.size)}
+
+Store = S3Store