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

Side by Side Diff: third_party/boto/ses/__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/services/submit.py ('k') | third_party/boto/ses/connection.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 Mitch Garnaat http://garnaat.org/
2 # Copyright (c) 2011 Harry Marr http://hmarr.com/
3 #
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish, dis-
8 # tribute, sublicense, and/or sell copies of the Software, and to permit
9 # persons to whom the Software is furnished to do so, subject to the fol-
10 # lowing conditions:
11 #
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
17 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
18 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 # IN THE SOFTWARE.
22
23 from connection import SESConnection
24 from boto.regioninfo import RegionInfo
25
26
27 def regions():
28 """
29 Get all available regions for the SES service.
30
31 :rtype: list
32 :return: A list of :class:`boto.regioninfo.RegionInfo` instances
33 """
34 return [RegionInfo(name='us-east-1',
35 endpoint='email.us-east-1.amazonaws.com',
36 connection_cls=SESConnection)]
37
38
39 def connect_to_region(region_name, **kw_params):
40 """
41 Given a valid region name, return a
42 :class:`boto.ses.connection.SESConnection`.
43
44 :type: str
45 :param region_name: The name of the region to connect to.
46
47 :rtype: :class:`boto.ses.connection.SESConnection` or ``None``
48 :return: A connection to the given region, or None if an invalid region
49 name is given
50 """
51 for region in regions():
52 if region.name == region_name:
53 return region.connect(**kw_params)
54 return None
OLDNEW
« no previous file with comments | « third_party/boto/services/submit.py ('k') | third_party/boto/ses/connection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698