|
@@ -29,7 +29,7 @@ from boto.exception import BotoClientError
|
|
|
from boto.s3.key import Key as S3Key
|
|
from boto.s3.key import Key as S3Key
|
|
|
from boto.s3.keyfile import KeyFile
|
|
from boto.s3.keyfile import KeyFile
|
|
|
from boto.utils import compute_hash
|
|
from boto.utils import compute_hash
|
|
|
-from boto.utils import get_utf8_value
|
|
|
|
|
|
|
+from boto.utils import get_utf8_value, get_utf8able_str
|
|
|
|
|
|
|
|
class Key(S3Key):
|
|
class Key(S3Key):
|
|
|
"""
|
|
"""
|
|
@@ -406,7 +406,7 @@ class Key(S3Key):
|
|
|
def set_contents_from_file(self, fp, headers=None, replace=True,
|
|
def set_contents_from_file(self, fp, headers=None, replace=True,
|
|
|
cb=None, num_cb=10, policy=None, md5=None,
|
|
cb=None, num_cb=10, policy=None, md5=None,
|
|
|
res_upload_handler=None, size=None, rewind=False,
|
|
res_upload_handler=None, size=None, rewind=False,
|
|
|
- if_generation=None):
|
|
|
|
|
|
|
+ if_generation=None, reduced_redundancy=None, query_args=None):
|
|
|
"""
|
|
"""
|
|
|
Store an object in GS using the name of the Key object as the
|
|
Store an object in GS using the name of the Key object as the
|
|
|
key in GS and the contents of the file pointed to by 'fp' as the
|
|
key in GS and the contents of the file pointed to by 'fp' as the
|
|
@@ -576,10 +576,10 @@ class Key(S3Key):
|
|
|
headers['x-goog-if-generation-match'] = str(if_generation)
|
|
headers['x-goog-if-generation-match'] = str(if_generation)
|
|
|
|
|
|
|
|
if res_upload_handler:
|
|
if res_upload_handler:
|
|
|
- res_upload_handler.send_file(self, fp, headers, cb, num_cb)
|
|
|
|
|
|
|
+ res_upload_handler.send_file(self, fp, headers, cb, num_cb, query_args=query_args)
|
|
|
else:
|
|
else:
|
|
|
# Not a resumable transfer so use basic send_file mechanism.
|
|
# Not a resumable transfer so use basic send_file mechanism.
|
|
|
- self.send_file(fp, headers, cb, num_cb, size=size)
|
|
|
|
|
|
|
+ self.send_file(fp, headers, cb, num_cb, size=size, query_args=query_args)
|
|
|
|
|
|
|
|
def set_contents_from_filename(self, filename, headers=None, replace=True,
|
|
def set_contents_from_filename(self, filename, headers=None, replace=True,
|
|
|
cb=None, num_cb=10, policy=None, md5=None,
|
|
cb=None, num_cb=10, policy=None, md5=None,
|
|
@@ -707,7 +707,7 @@ class Key(S3Key):
|
|
|
self.md5 = None
|
|
self.md5 = None
|
|
|
self.base64md5 = None
|
|
self.base64md5 = None
|
|
|
|
|
|
|
|
- fp = StringIO(get_utf8_value(s))
|
|
|
|
|
|
|
+ fp = StringIO(get_utf8able_str(s))
|
|
|
r = self.set_contents_from_file(fp, headers, replace, cb, num_cb,
|
|
r = self.set_contents_from_file(fp, headers, replace, cb, num_cb,
|
|
|
policy, md5,
|
|
policy, md5,
|
|
|
if_generation=if_generation)
|
|
if_generation=if_generation)
|