HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/s3transfer/__pycache__/copies.cpython-311.pyc
�

/�;f�8���ddlZddlZddlmZmZmZmZddlmZm	Z	m
Z
mZGd�de��ZGd�de��Z
Gd�d	e��ZdS)
�N)�CompleteMultipartUploadTask�CreateMultipartUploadTask�SubmissionTask�Task)�ChunksizeAdjuster�calculate_range_parameter�
get_callbacks�get_filtered_dictc
�l�eZdZdZdddddddd	d
d�	Zgd�Zgd
�Zgd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d�ZdS)�CopySubmissionTaskz+Task for submitting tasks to execute a copy�IfMatch�IfModifiedSince�IfNoneMatch�IfUnmodifiedSince�SSECustomerKey�SSECustomerAlgorithm�SSECustomerKeyMD5�RequestPayer�ExpectedBucketOwner)	�CopySourceIfMatch�CopySourceIfModifiedSince�CopySourceIfNoneMatch�CopySourceIfUnmodifiedSince�CopySourceSSECustomerKey�CopySourceSSECustomerAlgorithm�CopySourceSSECustomerKeyMD5rr)rrrrrrrrrrrr)	rrrrrrr�MetadataDirective�TaggingDirective)rrrrrc���|jj��|jj}|�|j��}|j}|���D]\}	}
|	|jvr|
||j|	<�|jj	di|��}|j�
|d��|jj|jkr|�|||||��dS|�
|||||��dS)a�
        :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            �D/opt/alt/python311/lib/python3.11/site-packages/s3transfer/copies.py�_submitzCopySubmissionTask._submitPsN��,��$�,�(�,�6�I��>�>��)���
 �
#�-�J�!+� 0� 0� 2� 2�
�
���u��D�@�@�@��(��<�U�C���;�y�.�:���%���H�
� �6�6���)�
�
�
���$�v�'A�A�A��%�%����(8�/�
�
�
�
�
�
�*�*����(8�/�
�
�
�
�
�c���|jj}t|d��}|j�|t|j||j|j|j|j	||jj
d�d�����dS)N�progress)r1r&�bucket�keyr'�	callbacksr#T)�transfer_coordinator�main_kwargs�is_final)r"r$r	�_transfer_coordinator�submit�CopyObjectTaskr&r?r@r'r#)r0r1r2r3r4r5r$�progress_callbackss        r:r.z'CopySubmissionTask._submit_copy_request�s���$�(�2�	�+�?�J�G�G��	
�"�)�)���%)�%?�$�#,�#8�'�.�$�=�"+�"6�!3�+�0�5����
�
�
�	
�	
�	
�	
�	
r<c��|jj}i}|j���D]\}}	||jvr|	||<�|j�|t|j||j|j	|d������}
|j
}t��}|�||jj
��}ttj|jj
t#|��z����}
g}t%|d��}t'd|
dz��D]�}|�|j��}t+||dz
|
|jj
��|d<|�||dz
|
|jj
��}|j�d��}|�|j�|t3|j||j|j|j	|||||d�	d|
i�	��������|�|j��}|j�|t9|j||j|j	|d�|
|d
�d�����dS)
N)r1r?r@r')rBrCr>��CopySourceRange�ChecksumAlgorithm)	r1r&r?r@�part_numberr'rAr#�checksum_algorithm�	upload_id)rBrC�pending_main_kwargs)rO�partsT)rBrCrPrD)r"r$r'r(�CREATE_MULTIPART_ARGS_BLACKLISTrErFrr?r@�multipart_chunksizer�adjust_chunksizer#�int�math�ceil�floatr	�range�_extra_upload_part_argsr�_get_transfer_size�get�append�CopyPartTaskr&�_extra_complete_multipart_argsr)r0r1r2r3r4r5r$�create_multipart_extra_argsr7�val�create_multipart_future�	part_size�adjuster�	num_parts�part_futuresrHrM�extra_part_argsr#rN�complete_multipart_extra_argss                     r:r/z,CopySubmissionTask._submit_multipart_request�s���$�(�2�	�')�#�#�.�4�4�6�6�	9�	9�J�E�3��D�@�@�@�58�+�E�2��"&�"<�"C�"C��%�%)�%?�$�'�.�$�=�"=�	��
�
�
�#
�#
���.�	�$�&�&���-�-���+�0�
�
�	���I�o�*�/�%�	�2B�2B�B�C�C�
�
�	�
��*�?�J�G�G�� ��I��M�2�2�,	�,	�K�"�:�:��$���O�2K���a����$�)�	2�2�O�-�.��*�*���a����$�)�	��D�"+�!5�!9�!9�:M�!N�!N������*�1�1�$� �-1�-G�&,�+4�+@�&/�&6�#,�=�+6�*9�);�$(�2D�
%�
%�(�)@�-������
�
�
�
�.)-�(K�(K�� �)
�)
�%�	
�"�)�)��'�%)�%?�$�'�.�$�=�"?�	��"9�)�%�%��

�

�

�	
�	
�	
�	
�	
r<c��t|t��rtj|��Std|�dt	|���d����)NzLExpecting dictionary formatted: {"Bucket": bucket_name, "Key": key} but got z	 or type �.)�
isinstance�dict�copy�	TypeError�type)r0r&s  r:r%z<CopySubmissionTask._get_head_object_request_from_copy_sourcesW���k�4�(�(�	��9�[�)�)�)��)�-8�K�K��k�9J�9J�9J�9J�L���
r<c�,�t||j��S�N)r
�UPLOAD_PART_COPY_ARGS�r0r's  r:rZz*CopySubmissionTask._extra_upload_part_argss��!��T�-G�H�H�Hr<c�,�t||j��Srq)r
�COMPLETE_MULTIPART_ARGSrss  r:r_z1CopySubmissionTask._extra_complete_multipart_args#s�� ��T�-I�J�J�Jr<c�(�||dz
kr|||zz
S|S)NrJr!)r0rc�
part_indexre�total_transfer_sizes     r:r[z%CopySubmissionTask._get_transfer_size&s+����Q��&�&�'�*�y�*@�A�A��r<N)�__name__�
__module__�__qualname__�__doc__r)rrrRrur;r.r/r%rZr_r[r!r<r:rrs�������5�5�'�%6�!.�':�$4�*@�':�&�4�
'�
'�#�
�
�
��
'�
'�
'�#�����<�<�<�|
�
�
�4j
�j
�j
�X���I�I�I�
K�K�K�����r<rc��eZdZdZd�ZdS)rGzTask to do a nonmultipart copyc�J�|jd|||d�|��|D]}||����dS)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)	r0r1r&r?r@r'rAr#�callbacks	         r:�_mainzCopyObjectTask._main3se��	���	
�"�6�s�	
�	
�>H�	
�	
�	
�"�	-�	-�H��H�t�,�,�,�,�,�	-�	-r<N�ryrzr{r|r�r!r<r:rGrG0s)������(�(�-�-�-�-�-r<rGc��eZdZdZ	dd�ZdS)r^z)Task to upload a part in a multipart copyNc	���|jd|||||d�|��}|D]}||	����|dd}
|
|d�}|
r2d|
�����}||dvr|d|||<|S)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.
        )rr�r��UploadId�
PartNumberr��CopyPartResult�ETag)r�r��Checksumr!)�upload_part_copy�upper)r0r1r&r?r@rOrMr'rAr#rNr9r��etag�
part_metadata�checksum_members                r:r�zCopyPartTask._mainLs���L+�6�*�
�"����"�
�
��

�
��"�	-�	-�H��H�t�,�,�,�,�,��(�)�&�1��!%�[�A�A�
��	�E�);�)A�)A�)C�)C�E�E�O��(�+;�"<�<�<�19�:J�1K�#�2�
�o�.��r<rqr�r!r<r:r^r^Is3������3�3� �8�8�8�8�8�8r<r^)rmrV�s3transfer.tasksrrrr�s3transfer.utilsrrr	r
rrGr^r!r<r:�<module>r�s"����������������������������������O�O�O�O�O��O�O�O�d-�-�-�-�-�T�-�-�-�2;�;�;�;�;�4�;�;�;�;�;r<