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

Side by Side Diff: third_party/boto/ecs/__init__.py

Issue 12633019: Added boto/ to depot_tools/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Moved boto down by one Created 7 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/boto/datapipeline/layer1.py ('k') | third_party/boto/ecs/item.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2010 Chris Moyer http://coredumped.org/
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions:
10 #
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 import boto
23 from boto.connection import AWSQueryConnection, AWSAuthConnection
24 import time
25 import urllib
26 import xml.sax
27 from boto.ecs.item import ItemSet
28 from boto import handler
29
30 class ECSConnection(AWSQueryConnection):
31 """
32 ECommerce Connection
33
34 For more information on how to use this module see:
35
36 http://blog.coredumped.org/2010/09/search-for-books-on-amazon-using-boto.htm l
37 """
38
39 APIVersion = '2010-11-01'
40
41 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
42 is_secure=True, port=None, proxy=None, proxy_port=None,
43 proxy_user=None, proxy_pass=None, host='ecs.amazonaws.com',
44 debug=0, https_connection_factory=None, path='/'):
45 AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_k ey,
46 is_secure, port, proxy, proxy_port, proxy_us er, proxy_pass,
47 host, debug, https_connection_factory, path)
48
49 def _required_auth_capability(self):
50 return ['ecs']
51
52 def get_response(self, action, params, page=0, itemSet=None):
53 """
54 Utility method to handle calls to ECS and parsing of responses.
55 """
56 params['Service'] = "AWSECommerceService"
57 params['Operation'] = action
58 if page:
59 params['ItemPage'] = page
60 response = self.make_request(None, params, "/onca/xml")
61 body = response.read()
62 boto.log.debug(body)
63
64 if response.status != 200:
65 boto.log.error('%s %s' % (response.status, response.reason))
66 boto.log.error('%s' % body)
67 raise self.ResponseError(response.status, response.reason, body)
68
69 if itemSet == None:
70 rs = ItemSet(self, action, params, page)
71 else:
72 rs = itemSet
73 h = handler.XmlHandler(rs, self)
74 xml.sax.parseString(body, h)
75 return rs
76
77 #
78 # Group methods
79 #
80
81 def item_search(self, search_index, **params):
82 """
83 Returns items that satisfy the search criteria, including one or more se arch
84 indices.
85
86 For a full list of search terms,
87 :see: http://docs.amazonwebservices.com/AWSECommerceService/2010-09-01/D G/index.html?ItemSearch.html
88 """
89 params['SearchIndex'] = search_index
90 return self.get_response('ItemSearch', params)
OLDNEW
« no previous file with comments | « third_party/boto/datapipeline/layer1.py ('k') | third_party/boto/ecs/item.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698