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

Unified Diff: boto/sdb/connection.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/sdb/__init__.py ('k') | boto/sdb/db/blob.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: boto/sdb/connection.py
diff --git a/boto/sdb/connection.py b/boto/sdb/connection.py
index b5a45b882e4187c02b06d7f6fe126034bd28912c..f043193242a0d23c635d3046ef28d1f6367abf40 100644
--- a/boto/sdb/connection.py
+++ b/boto/sdb/connection.py
@@ -21,6 +21,7 @@
import xml.sax
import threading
+import boto
from boto import handler
from boto.connection import AWSQueryConnection
from boto.sdb.domain import Domain, DomainMetaData
@@ -32,12 +33,10 @@ class ItemThread(threading.Thread):
"""
A threaded :class:`Item <boto.sdb.item.Item>` retriever utility class.
Retrieved :class:`Item <boto.sdb.item.Item>` objects are stored in the
- ``items`` instance variable after
- :py:meth:`run() <run>` is called.
+ ``items`` instance variable after :py:meth:`run() <run>` is called.
- .. tip::
- The item retrieval will not start until the
- :func:`run() <boto.sdb.connection.ItemThread.run>` method is called.
+ .. tip:: The item retrieval will not start until
+ the :func:`run() <boto.sdb.connection.ItemThread.run>` method is called.
"""
def __init__(self, name, domain_name, item_names):
"""
@@ -87,7 +86,7 @@ class SDBConnection(AWSQueryConnection):
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- converter=None):
+ converter=None, security_token=None):
"""
For any keywords that aren't documented, refer to the parent class,
:py:class:`boto.connection.AWSAuthConnection`. You can avoid having
@@ -95,19 +94,30 @@ class SDBConnection(AWSQueryConnection):
via :py:func:`boto.connect_sdb`.
:type region: :class:`boto.sdb.regioninfo.SDBRegionInfo`
- :keyword region: Explicitly specify a region. Defaults to ``us-east-1``
- if not specified.
+ :keyword region: Explicitly specify a region. Defaults to ``us-east-1``
+ if not specified. You may also specify the region in your ``boto.cfg``:
+
+ .. code-block:: cfg
+
+ [SDB]
+ region = eu-west-1
+
"""
if not region:
- region = SDBRegionInfo(self, self.DefaultRegionName,
- self.DefaultRegionEndpoint)
+ region_name = boto.config.get('SDB', 'region', self.DefaultRegionName)
+ for reg in boto.sdb.regions():
+ if reg.name == region_name:
+ region = reg
+ break
+
self.region = region
AWSQueryConnection.__init__(self, aws_access_key_id,
aws_secret_access_key,
is_secure, port, proxy,
proxy_port, proxy_user, proxy_pass,
self.region.endpoint, debug,
- https_connection_factory, path)
+ https_connection_factory, path,
+ security_token=security_token)
self.box_usage = 0.0
self.converter = converter
self.item_cls = Item
« no previous file with comments | « boto/sdb/__init__.py ('k') | boto/sdb/db/blob.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698