我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用boto.s3.connection.SubdomainCallingFormat()。
def __init__(self, region, access_key, secret_key, bucket_name, secure=True, num_retries=5, socket_timeout=15): self.region = region self.access_key = access_key self.secret_key = secret_key self.secure = secure self.num_retries = num_retries self.socket_timeout = socket_timeout # monkey patch for bucket_name with dots # https://github.com/boto/boto/issues/2836 if self.secure and '.' in bucket_name: self.calling_format = OrdinaryCallingFormat() else: self.calling_format = SubdomainCallingFormat() for section in boto.config.sections(): boto.config.remove_section(section) boto.config.add_section('Boto') boto.config.setbool('Boto', 'is_secure', self.secure) boto.config.set('Boto', 'http_socket_timeout', str(self.socket_timeout)) boto.config.set('Boto', 'num_retries', str(self.num_retries)) self._conn = None self.connect()
def __init__(self, gs_access_key_id=None, gs_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, host=DefaultHost, debug=0, https_connection_factory=None, calling_format=SubdomainCallingFormat(), path='/', suppress_consec_slashes=True): super(GSConnection, self).__init__(gs_access_key_id, gs_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, host, debug, https_connection_factory, calling_format, path, "google", Bucket, suppress_consec_slashes=suppress_consec_slashes)
def __init__(self, gs_access_key_id=None, gs_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, host=DefaultHost, debug=0, https_connection_factory=None, calling_format=SubdomainCallingFormat(), path='/', suppress_consec_slashes=True): S3Connection.__init__(self, gs_access_key_id, gs_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, host, debug, https_connection_factory, calling_format, path, "google", Bucket, suppress_consec_slashes=suppress_consec_slashes)