| OLD | NEW |
| 1 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ | 1 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ |
| 2 # | 2 # |
| 3 # Permission is hereby granted, free of charge, to any person obtaining a | 3 # Permission is hereby granted, free of charge, to any person obtaining a |
| 4 # copy of this software and associated documentation files (the | 4 # copy of this software and associated documentation files (the |
| 5 # "Software"), to deal in the Software without restriction, including | 5 # "Software"), to deal in the Software without restriction, including |
| 6 # without limitation the rights to use, copy, modify, merge, publish, dis- | 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 | 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- | 8 # persons to whom the Software is furnished to do so, subject to the fol- |
| 9 # lowing conditions: | 9 # lowing conditions: |
| 10 # | 10 # |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 """ | 79 """ |
| 80 DefaultRegionName = 'us-east-1' | 80 DefaultRegionName = 'us-east-1' |
| 81 DefaultRegionEndpoint = 'sdb.us-east-1.amazonaws.com' | 81 DefaultRegionEndpoint = 'sdb.us-east-1.amazonaws.com' |
| 82 APIVersion = '2009-04-15' | 82 APIVersion = '2009-04-15' |
| 83 ResponseError = SDBResponseError | 83 ResponseError = SDBResponseError |
| 84 | 84 |
| 85 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, | 85 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, |
| 86 is_secure=True, port=None, proxy=None, proxy_port=None, | 86 is_secure=True, port=None, proxy=None, proxy_port=None, |
| 87 proxy_user=None, proxy_pass=None, debug=0, | 87 proxy_user=None, proxy_pass=None, debug=0, |
| 88 https_connection_factory=None, region=None, path='/', | 88 https_connection_factory=None, region=None, path='/', |
| 89 converter=None, security_token=None, validate_certs=True): | 89 converter=None, security_token=None, validate_certs=True, |
| 90 profile_name=None): |
| 90 """ | 91 """ |
| 91 For any keywords that aren't documented, refer to the parent class, | 92 For any keywords that aren't documented, refer to the parent class, |
| 92 :py:class:`boto.connection.AWSAuthConnection`. You can avoid having | 93 :py:class:`boto.connection.AWSAuthConnection`. You can avoid having |
| 93 to worry about these keyword arguments by instantiating these objects | 94 to worry about these keyword arguments by instantiating these objects |
| 94 via :py:func:`boto.connect_sdb`. | 95 via :py:func:`boto.connect_sdb`. |
| 95 | 96 |
| 96 :type region: :class:`boto.sdb.regioninfo.SDBRegionInfo` | 97 :type region: :class:`boto.sdb.regioninfo.SDBRegionInfo` |
| 97 :keyword region: Explicitly specify a region. Defaults to ``us-east-1`` | 98 :keyword region: Explicitly specify a region. Defaults to ``us-east-1`` |
| 98 if not specified. You may also specify the region in your ``boto.cfg
``: | 99 if not specified. You may also specify the region in your ``boto.cfg
``: |
| 99 | 100 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 111 break | 112 break |
| 112 | 113 |
| 113 self.region = region | 114 self.region = region |
| 114 super(SDBConnection, self).__init__(aws_access_key_id, | 115 super(SDBConnection, self).__init__(aws_access_key_id, |
| 115 aws_secret_access_key, | 116 aws_secret_access_key, |
| 116 is_secure, port, proxy, | 117 is_secure, port, proxy, |
| 117 proxy_port, proxy_user, proxy_pass, | 118 proxy_port, proxy_user, proxy_pass, |
| 118 self.region.endpoint, debug, | 119 self.region.endpoint, debug, |
| 119 https_connection_factory, path, | 120 https_connection_factory, path, |
| 120 security_token=security_token, | 121 security_token=security_token, |
| 121 validate_certs=validate_certs) | 122 validate_certs=validate_certs, |
| 123 profile_name=profile_name) |
| 122 self.box_usage = 0.0 | 124 self.box_usage = 0.0 |
| 123 self.converter = converter | 125 self.converter = converter |
| 124 self.item_cls = Item | 126 self.item_cls = Item |
| 125 | 127 |
| 126 def _required_auth_capability(self): | 128 def _required_auth_capability(self): |
| 127 return ['sdb'] | 129 return ['sdb'] |
| 128 | 130 |
| 129 def set_item_cls(self, cls): | 131 def set_item_cls(self, cls): |
| 130 """ | 132 """ |
| 131 While the default item class is :py:class:`boto.sdb.item.Item`, this | 133 While the default item class is :py:class:`boto.sdb.item.Item`, this |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 if consistent_read: | 610 if consistent_read: |
| 609 params['ConsistentRead'] = 'true' | 611 params['ConsistentRead'] = 'true' |
| 610 if next_token: | 612 if next_token: |
| 611 params['NextToken'] = next_token | 613 params['NextToken'] = next_token |
| 612 try: | 614 try: |
| 613 return self.get_list('Select', params, [('Item', self.item_cls)], | 615 return self.get_list('Select', params, [('Item', self.item_cls)], |
| 614 parent=domain) | 616 parent=domain) |
| 615 except SDBResponseError, e: | 617 except SDBResponseError, e: |
| 616 e.body = "Query: %s\n%s" % (query, e.body) | 618 e.body = "Query: %s\n%s" % (query, e.body) |
| 617 raise e | 619 raise e |
| OLD | NEW |