Index: boto/iam/summarymap.py |
diff --git a/boto/s3/prefix.py b/boto/iam/summarymap.py |
similarity index 72% |
copy from boto/s3/prefix.py |
copy to boto/iam/summarymap.py |
index fc0f26ab58ae063bce32b60d916709c5858e1002..00023895f32c44ef27a050d0f3fa4bece12de4c8 100644 |
--- a/boto/s3/prefix.py |
+++ b/boto/iam/summarymap.py |
@@ -1,4 +1,5 @@ |
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ |
+# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ |
+# Copyright (c) 2010, Eucalyptus Systems, Inc. |
# |
# Permission is hereby granted, free of charge, to any person obtaining a |
# copy of this software and associated documentation files (the |
@@ -14,22 +15,28 @@ |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- |
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT |
-# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
# IN THE SOFTWARE. |
-class Prefix: |
- def __init__(self, bucket=None, name=None): |
- self.bucket = bucket |
- self.name = name |
+class SummaryMap(dict): |
+ |
+ def __init__(self, parent=None): |
+ self.parent = parent |
+ dict.__init__(self) |
def startElement(self, name, attrs, connection): |
- return None |
+ pass |
def endElement(self, name, value, connection): |
- if name == 'Prefix': |
- self.name = value |
+ if name == 'key': |
+ self._name = value |
+ elif name == 'value': |
+ try: |
+ self[self._name] = int(value) |
+ except ValueError: |
+ self[self._name] = value |
else: |
setattr(self, name, value) |