diff options
author | James Saryerwinnie <js@jamesls.com> | 2013-04-18 04:14:08 -0700 |
---|---|---|
committer | James Saryerwinnie <js@jamesls.com> | 2013-04-18 04:14:08 -0700 |
commit | 89f4947000587e12042e5b35c4557871b21137b9 (patch) | |
tree | 0606c64058f8402e74b29c621105b74292ff366c /boto/handler.py | |
parent | b5852b0aa5ac91f462b28ac9decee33d872dec4d (diff) | |
parent | 699d861f453aff8a398f9cd5a8de91ec8e36a8cf (diff) | |
download | boto-2.9.0.tar.gz |
Merge branch 'release-2.9.0'2.9.0
* release-2.9.0: (158 commits)
Bump version to 2.9.0
Added underlying DynamoDB v2 support.
Add redshift to setup.py/docs index
Updated requests to something more modern.
Only use 2 metadata service calls to get credentials
Fix #1146: return response from custom url opener
Fixed missing import.
Add metadata_service_num_attempts config option
Added cleanup for the snapshots created.
Added support for redshift.
Let total attempts by 1 + num_retries
Add more diagnostics to debug logs
Change GS calls to make_request to always convert to utf-8 bytes.
Allow kwargs to be passed through to uplaoder
Remove whitespace, fix long line lengths
Improve VPC and VPN support
Added sleeps to allow amazon time to propogate
Added error handling for out of space during downloads
Initial integration tests for idempotent subscribe
Removed dead code from resumable upload handler
...
Diffstat (limited to 'boto/handler.py')
-rw-r--r-- | boto/handler.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/boto/handler.py b/boto/handler.py index 8f37dff1..df065cca 100644 --- a/boto/handler.py +++ b/boto/handler.py @@ -19,6 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +import StringIO import xml.sax class XmlHandler(xml.sax.ContentHandler): @@ -42,3 +43,14 @@ class XmlHandler(xml.sax.ContentHandler): def characters(self, content): self.current_text += content + + +class XmlHandlerWrapper(object): + def __init__(self, root_node, connection): + self.handler = XmlHandler(root_node, connection) + self.parser = xml.sax.make_parser() + self.parser.setContentHandler(self.handler) + self.parser.setFeature(xml.sax.handler.feature_external_ges, 0) + + def parseString(self, content): + return self.parser.parse(StringIO.StringIO(content)) |