Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1388)

Unified Diff: third_party/boto/boto/core/service.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/boto/boto/core/dictresponse.py ('k') | third_party/boto/boto/datapipeline/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/boto/core/service.py
===================================================================
--- third_party/boto/boto/core/service.py (revision 33376)
+++ third_party/boto/boto/core/service.py (working copy)
@@ -1,67 +0,0 @@
-# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
-# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
-# All Rights Reserved
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish, dis-
-# tribute, sublicense, and/or sell copies of the Software, and to permit
-# persons to whom the Software is furnished to do so, subject to the fol-
-# lowing conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# 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,
-# 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.
-#
-
-import requests
-from .auth import SigV2Auth
-from .credentials import get_credentials
-from .dictresponse import Element, XmlHandler
-
-
-class Service(object):
- """
- This is a simple example service that connects to the EC2 endpoint
- and supports a single request (DescribeInstances) to show how to
- use the requests-based code rather than the standard boto code which
- is based on httplib. At the moment, the only auth mechanism
- supported is SigV2.
- """
-
- def __init__(self, host='https://ec2.us-east-1.amazonaws.com',
- path='/', api_version='2012-03-01', persona=None):
- self.credentials = get_credentials(persona)
- self.auth = SigV2Auth(self.credentials, api_version=api_version)
- self.host = host
- self.path = path
-
- def get_response(self, params, list_marker=None):
- r = requests.post(self.host, params=params,
- hooks={'args': self.auth.add_auth})
- r.encoding = 'utf-8'
- body = r.text.encode('utf-8')
- e = Element(list_marker=list_marker, pythonize_name=True)
- h = XmlHandler(e, self)
- h.parse(body)
- return e
-
- def build_list_params(self, params, items, label):
- if isinstance(items, basestring):
- items = [items]
- for i in range(1, len(items) + 1):
- params['%s.%d' % (label, i)] = items[i - 1]
-
- def describe_instances(self, instance_ids=None):
- params = {}
- if instance_ids:
- self.build_list_params(params, instance_ids, 'InstanceId')
- return self.get_response(params)
« no previous file with comments | « third_party/boto/boto/core/dictresponse.py ('k') | third_party/boto/boto/datapipeline/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698