ó èc<^c@sÞddlZddlZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm Z dd lm Z d efd „ƒYZ d efd „ƒYZ defd„ƒYZdS(iÿÿÿÿN(tTask(tSubmissionTask(tCreateMultipartUploadTask(tCompleteMultipartUploadTask(t get_callbacks(tcalculate_range_parameter(tget_filtered_dict(tChunksizeAdjustertCopySubmissionTaskc BsÜeZdZidd6dd6dd6dd6d d 6d d 6d d6dd6Zddddd d dd d d dg Zddddd d dddg ZdgZd„Zd„Zd„Z d„Z d„Z d„Z d„Z RS(s+Task for submitting tasks to execute a copytIfMatchtCopySourceIfMatchtIfModifiedSincetCopySourceIfModifiedSincet IfNoneMatchtCopySourceIfNoneMatchtIfUnmodifiedSincetCopySourceIfUnmodifiedSincetSSECustomerKeytCopySourceSSECustomerKeytSSECustomerAlgorithmtCopySourceSSECustomerAlgorithmtSSECustomerKeyMD5tCopySourceSSECustomerKeyMD5t RequestPayertMetadataDirectivetTaggingDirectivec Csð|jjdkr¢|jj}|j|jƒ}|j}x=|jƒD]/\} } | |jkrF| ||j| cBseZdZd„ZRS(sTask to do a nonmultipart copyc CsA|jd|d|d||x|D]}|d|ƒq&WdS(sÿ :param client: The client to use when calling PutObject :param copy_source: The CopySource parameter to use :param bucket: The name of the bucket to copy to :param key: The name of the key to copy to :param extra_args: A dictionary of any extra arguments that may be used in the upload. :param callbacks: List of callbacks to call after copy :param size: The size of the transfer. This value is passed into the callbacks t CopySourcetBuckettKeytbytes_transferredN(t copy_object( R*R+R R8R9R!R:Rtcallback((s</opt/awscli/lib/python2.7/site-packages/s3transfer/copies.pyt_mains  (ReRfRgRn(((s</opt/awscli/lib/python2.7/site-packages/s3transfer/copies.pyR>sRQcBseZdZd„ZRS(s)Task to upload a part in a multipart copyc Csk|jd|d|d|d|d||} x|D]} | d| ƒq4W| dd} i| d6|d6S( sŠ :param client: The client to use when calling PutObject :param copy_source: The CopySource parameter to use :param bucket: The name of the bucket to upload to :param key: The name of the key to upload to :param upload_id: The id of the upload :param part_number: The number representing the part of the multipart upload :param extra_args: A dictionary of any extra arguments that may be used in the upload. :param callbacks: List of callbacks to call after copy part :param size: The size of the transfer. This value is passed into the callbacks :rtype: dict :returns: A dictionary representing a part:: {'Etag': etag_value, 'PartNumber': part_number} This value can be appended to a list to be used to complete the multipart upload. RhRiRjtUploadIdt PartNumberRktCopyPartResulttETag(tupload_part_copy( R*R+R R8R9RDRBR!R:RR3Rmtetag((s</opt/awscli/lib/python2.7/site-packages/s3transfer/copies.pyRn&s  (ReRfRgRn(((s</opt/awscli/lib/python2.7/site-packages/s3transfer/copies.pyRQ$s(R^RJts3transfer.tasksRRRRts3transfer.utilsRRRRRR>RQ(((s</opt/awscli/lib/python2.7/site-packages/s3transfer/copies.pyt s  ô