~oubiwann/txaws/416109-arbitrary-endpoints

« back to all changes in this revision

Viewing changes to txaws/service.py

  • Committer: Duncan McGreggor
  • Date: 2009-08-25 20:31:52 UTC
  • Revision ID: duncan@canonical.com-20090825203152-jm53jznolytd30vx
- Added access and secret key parameters to the AWSServiceRegion constructor.
- Updated AWSServiceRegion to create creds based on access and secret key if no
  creds are supplied.
- Updated docstrings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
from twisted.web.client import _parse
8
8
 
 
9
from txaws.credentials import AWSCredentials
9
10
 
10
11
 
11
12
__all__ = ["AWSServiceEndpoint", "AWSServiceRegion", "REGION_US", "REGION_EU"]
57
58
    This object represents a collection of client factories that use the same
58
59
    credentials. With Amazon, this collection is associated with a region
59
60
    (e.g., US or EU).
 
61
 
 
62
    @param creds: an AWSCredentials instance, optional.
 
63
    @param access_key: The access key to use. This is only checked if no creds
 
64
        parameter was passed.
 
65
    @param secret_key: The secret key to use. This is only checked if no creds
 
66
        parameter was passed.
 
67
    @param region: a string value that represents the region that the
 
68
        associated creds will be used against a collection of services.
60
69
    """
61
 
    def __init__(self, creds=None, region=REGION_US):
 
70
    def __init__(self, creds=None, access_key="", secret_key="",
 
71
                 region=REGION_US):
 
72
        if not creds:
 
73
            creds = AWSCredentials(access_key, secret_key)
62
74
        self.creds = creds
63
75
        self._clients = {}
64
76
        if region == REGION_US: