ó
    TQÇg�8  ã                   ó†   • S SK r S SKrS SKJrJrJrJr  S SKJrJ	r	J
r
Jr   " S S\5      r " S S\5      r " S S	\5      rg)
é    N)ÚCompleteMultipartUploadTaskÚCreateMultipartUploadTaskÚSubmissionTaskÚTask)ÚChunksizeAdjusterÚcalculate_range_parameterÚget_callbacksÚget_filtered_dictc            
       ór   • \ rS rSrSrSSSSSSS	S
SS.	r/ SQr/ SQr/ SQrS r	S r
S rS rS rS rS rSrg)ÚCopySubmissionTaské   z+Task for submitting tasks to execute a copyÚIfMatchÚIfModifiedSinceÚIfNoneMatchÚIfUnmodifiedSinceÚSSECustomerKeyÚSSECustomerAlgorithmÚSSECustomerKeyMD5ÚRequestPayerÚExpectedBucketOwner)	ÚCopySourceIfMatchÚCopySourceIfModifiedSinceÚCopySourceIfNoneMatchÚCopySourceIfUnmodifiedSinceÚCopySourceSSECustomerKeyÚCopySourceSSECustomerAlgorithmÚCopySourceSSECustomerKeyMD5r   r   )r   r   r   r   r   r   r   r   r   r   r   r   )	r   r   r   r   r   r   r   ÚMetadataDirectiveÚTaggingDirective)r   r   r   r   r   c                 ó.  • UR                   R                  c³  UR                   R                  nU R                  UR                  5      nUR
                  nUR                  5        H(  u  pšX�R                  ;   d  M  U
UU R                  U	   '   M*     UR                  R                  " S0 UD6nUR                   R                  US   5        UR                   R                  UR                  :  a  U R                  XX4U5        gU R                  XX4U5        g)aj  
:param client: The client associated with the transfer manager

:type config: s3transfer.manager.TransferConfig
:param config: The transfer config associated with the transfer
    manager

:type osutil: s3transfer.utils.OSUtil
:param osutil: The os utility associated to the transfer manager

:type request_executor: s3transfer.futures.BoundedExecutor
:param request_executor: The request executor associated with the
    transfer manager

:type transfer_future: s3transfer.futures.TransferFuture
:param transfer_future: The transfer future associated with the
    transfer request that tasks are being submitted for
NÚContentLength© )ÚmetaÚsizeÚ	call_argsÚ)_get_head_object_request_from_copy_sourceÚcopy_sourceÚ
extra_argsÚitemsÚEXTRA_ARGS_TO_HEAD_ARGS_MAPPINGÚsource_clientÚhead_objectÚprovide_transfer_sizeÚmultipart_thresholdÚ_submit_copy_requestÚ_submit_multipart_request)ÚselfÚclientÚconfigÚosutilÚrequest_executorÚtransfer_futurer%   Úhead_object_requestr(   ÚparamÚvalueÚresponses               Ú3/usr/lib/python3/dist-packages/s3transfer/copies.pyÚ_submitÚCopySubmissionTask._submitP   s  € ð, ×Ñ×$Ñ$Ñ,ð (×,Ñ,×6Ñ6ˆIà×>Ñ>Ø×)Ñ)óð  ð
 #×-Ñ-ˆJð !+× 0Ñ 0Ö 2‘�Ø×@Ñ@Õ@ð ð (Ø×<Ñ<¸UÑCóñ !3ð !×.Ñ.×:Ò:ñ Ø%ñˆHð × Ñ ×6Ñ6Ø˜Ñ)ôð ×Ñ×$Ñ$ v×'AÑ'AÓAØ×%Ñ%Ø ¸/õð ×*Ñ*Ø ¸/õó    c                 ó.  • UR                   R                  n[        US5      nU R                  R	                  U[        U R                  UUR                  UR                  UR                  UR                  UUR                   R                  S.SS95        g )NÚprogress)r2   r'   ÚbucketÚkeyr(   Ú	callbacksr$   T)Útransfer_coordinatorÚmain_kwargsÚis_final)r#   r%   r	   Ú_transfer_coordinatorÚsubmitÚCopyObjectTaskr'   rA   rB   r(   r$   )r1   r2   r3   r4   r5   r6   r%   Úprogress_callbackss           r;   r/   Ú'CopySubmissionTask._submit_copy_requestŽ   s�   € ð $×(Ñ(×2Ñ2ˆ	ô +¨?¸JÓGÐð 	×"Ñ"×)Ñ)ØÜØ%)×%?Ñ%?à$Ø#,×#8Ñ#8Ø'×.Ñ.Ø$Ÿ=™=Ø"+×"6Ñ"6Ø!3Ø+×0Ñ0×5Ñ5ñð ñõ	
r>   c                 ó  • UR                   R                  n0 nUR                  R                  5        H  u  p‰X€R                  ;  d  M  X—U'   M     U R
                  R                  U[        U R
                  UUR                  UR                  US.S95      n
UR                  n[        5       nUR                  XµR                   R                  5      n[        [        R                   " UR                   R                  [#        U5      -  5      5      n/ n[%        US5      n['        SUS-   5       Hô  nU R)                  UR                  5      n[+        UUS-
  UUR                   R                  5      US'   U R-                  UUS-
  UUR                   R                  5      nUR                  R/                  S5      nUR1                  U R
                  R                  U[3        U R
                  UUR4                  UR                  UR                  UUUUUS.	SU
0S	95      5        Mö     U R7                  UR                  5      nU R
                  R                  U[9        U R
                  UUR                  UR                  US.U
US
.SS95        g )N)r2   rA   rB   r(   )rD   rE   r@   é   ÚCopySourceRangeÚChecksumAlgorithm)	r2   r'   rA   rB   Úpart_numberr(   rC   r$   Úchecksum_algorithmÚ	upload_id)rD   rE   Úpending_main_kwargs)rR   ÚpartsT)rD   rE   rS   rF   )r#   r%   r(   r)   ÚCREATE_MULTIPART_ARGS_BLACKLISTrG   rH   r   rA   rB   Úmultipart_chunksizer   Úadjust_chunksizer$   ÚintÚmathÚceilÚfloatr	   ÚrangeÚ_extra_upload_part_argsr   Ú_get_transfer_sizeÚgetÚappendÚCopyPartTaskr'   Ú_extra_complete_multipart_argsr   )r1   r2   r3   r4   r5   r6   r%   Úcreate_multipart_extra_argsr8   ÚvalÚcreate_multipart_futureÚ	part_sizeÚadjusterÚ	num_partsÚpart_futuresrJ   rP   Úextra_part_argsr$   rQ   Úcomplete_multipart_extra_argss                        r;   r0   Ú,CopySubmissionTask._submit_multipart_request¨   s–  € ð $×(Ñ(×2Ñ2ˆ	ð ')Ð#Ø#×.Ñ.×4Ñ4Ö6‰JˆEØ×@Ñ@Õ@Ø58¨EÓ2ñ 7ð #'×"<Ñ"<×"CÑ"CØÜ%Ø%)×%?Ñ%?à$Ø'×.Ñ.Ø$Ÿ=™=Ø"=ñ	ñó#
Ðð ×.Ñ.ˆ	Ü$Ó&ˆØ×-Ñ-Ø×+Ñ+×0Ñ0ó
ˆ	ô Ü�IŠI�o×*Ñ*×/Ñ/´%¸	Ó2BÑBÓCó
ˆ	ð
 ˆÜ*¨?¸JÓGÐä   I°¡MÖ2ˆKØ"×:Ñ:Ø×$Ñ$óˆOô 2KØØ˜a‘ØØ×$Ñ$×)Ñ)ó	2ˆOÐ-Ñ.ð ×*Ñ*ØØ˜a‘ØØ×$Ñ$×)Ñ)ó	ˆDð "+×!5Ñ!5×!9Ñ!9Ð:MÓ!NÐØ×ÑØ×*Ñ*×1Ñ1Ø$Ü Ø-1×-GÑ-Gà&,Ø+4×+@Ñ+@Ø&/×&6Ñ&6Ø#,§=¡=Ø+6Ø*9Ø);Ø$(Ø2Dñ
%ð (Ð)@ð-ñóöñ/ 3ð\ )-×(KÑ(KØ× Ñ ó)
Ð%ð 	×"Ñ"×)Ñ)ØÜ'Ø%)×%?Ñ%?à$Ø'×.Ñ.Ø$Ÿ=™=Ø"?ñ	ð "9Ø)ñ%ð ñõ	
r>   c                 óŽ   • [        U[        5      (       a  [        R                  " U5      $ [        SU S[	        U5       S35      e)NzLExpecting dictionary formatted: {"Bucket": bucket_name, "Key": key} but got z	 or type Ú.)Ú
isinstanceÚdictÚcopyÚ	TypeErrorÚtype)r1   r'   s     r;   r&   Ú<CopySubmissionTask._get_head_object_request_from_copy_source  sI   € Ü�k¤4×(Ñ(Ü—9’9˜[Ó)Ð)äðà&˜- y´°kÓ1BÐ0CÀ1ðFóð r>   c                 ó,   • [        XR                  5      $ ©N)r
   ÚUPLOAD_PART_COPY_ARGS©r1   r(   s     r;   r]   Ú*CopySubmissionTask._extra_upload_part_args  s   € ô ! ×-GÑ-GÓHÐHr>   c                 ó,   • [        XR                  5      $ rv   )r
   ÚCOMPLETE_MULTIPART_ARGSrx   s     r;   rb   Ú1CopySubmissionTask._extra_complete_multipart_args#  s   € Ü  ×-IÑ-IÓJÐJr>   c                 ó$   • X#S-
  :X  a  XBU-  -
  $ U$ )NrM   r"   )r1   rf   Ú
part_indexrh   Útotal_transfer_sizes        r;   r^   Ú%CopySubmissionTask._get_transfer_size&  s$   € ð  Q™Ó&ð '°yÑ*@ÑAÐAØÐr>   r"   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r*   rw   rU   r{   r<   r/   r0   r&   r]   rb   r^   Ú__static_attributes__r"   r>   r;   r   r      sj   † Ù5ð 'Ø%6Ø!.Ø':Ø$4Ø*@Ø':Ø&Ø4ñ
'Ð#òÐò
'Ð#òÐò<ò|
ò4j
òXòIò
Kõr>   r   c                   ó   • \ rS rSrSrS rSrg)rI   i0  zTask to do a nonmultipart copyc                 óL   • UR                   " SX#US.UD6  U H	  nU" US9  M     g)a¯  
: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

)Ú
CopySourceÚBucketÚKey©Úbytes_transferredNr"   )Úcopy_object)	r1   r2   r'   rA   rB   r(   rC   r$   Úcallbacks	            r;   Ú_mainÚCopyObjectTask._main3  s8   € ð 	×Òð 	
Ø"°sñ	
Ø>Hò	
ó "ˆHÙ tÔ,ò "r>   r"   N©r�   r‚   rƒ   r„   r…   r�   r†   r"   r>   r;   rI   rI   0  s
   † Ù(õ-r>   rI   c                   ó$   • \ rS rSrSr SS jrSrg)ra   iI  z)Task to upload a part in a multipart copyNc           	      óÄ   • UR                   " SUUUUUS.UD6nU H	  nU" U	S9  M     US   S   nXÖS.nU
(       a%  SU
R                  5        3nXûS   ;   a
  US   U   Xï'   U$ )a”  
: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
:param checksum_algorithm: The algorithm that was used to create the multipart
    upload

: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. If a checksum is in the response,
    it will also be included.
)r‰   rŠ   r‹   ÚUploadIdÚ
PartNumberrŒ   ÚCopyPartResultÚETag)r˜   r–   ÚChecksumr"   )Úupload_part_copyÚupper)r1   r2   r'   rA   rB   rR   rP   r(   rC   r$   rQ   r:   r�   ÚetagÚpart_metadataÚchecksum_members                   r;   r�   ÚCopyPartTask._mainL  s£   € ðL ×*Ò*ð 
Ø"ØØØØ"ñ
ð ñ
ˆó "ˆHÙ tÔ,ñ "àÐ(Ñ)¨&Ñ1ˆØ!%ÑAˆÞØ (Ð);×)AÑ)AÓ)CÐ(DÐEˆOØÐ+;Ñ"<Ó<Ø19Ð:JÑ1KØ#ñ2�Ñ.ð Ðr>   r"   rv   r’   r"   r>   r;   ra   ra   I  s   † Ù3ð  ÷8r>   ra   )rq   rY   Ús3transfer.tasksr   r   r   r   Ús3transfer.utilsr   r   r	   r
   r   rI   ra   r"   r>   r;   Ú<module>r¢      sH   ðó Û ÷ó ÷ó ôO˜ô Oôd-�Tô -ô2;�4õ ;r>   