
    vKg8                         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  pXR                  ;   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               Q/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/s3transfer/copies.py_submitCopySubmissionTask._submitP   s   , $$, (,,66I>>))  
 #--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  pXR                  ;  d  M  XU'   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                  XR                   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6JE@@@58E2 7 #'"<"<"C"C%%)%?%?$'..$=="=	#
 ..	$&--++00
	 IIo**//%	2BBC
	
 *?JG IM2K"::$$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    k4((99[))&-yk1B0C1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XS.nU
(       a%  SU
R                  5        3nXS   ;   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EO+;"<<19:J1K#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>   