Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/s3transfer/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/s3transfer/__pycache__/copies.cpython-38.pyc
U

P��g�8�@stddlZddlZddlmZmZmZmZddlmZm	Z	m
Z
mZGdd�de�ZGdd�de�Z
Gdd	�d	e�ZdS)
�N)�CompleteMultipartUploadTask�CreateMultipartUploadTask�SubmissionTask�Task)�ChunksizeAdjuster�calculate_range_parameter�
get_callbacks�get_filtered_dictc@s�eZdZdZdddddddd	d
d�	Zdd
ddddddddd	d
gZdd
dddddddg	Zdddd	d
gZdd�Zdd�Z	dd�Z
dd�Zdd�Zdd �Z
d!d"�Zd#S)$�CopySubmissionTaskz+Task for submitting tasks to execute a copyZIfMatchZIfModifiedSinceZIfNoneMatchZIfUnmodifiedSinceZSSECustomerKeyZSSECustomerAlgorithmZSSECustomerKeyMD5�RequestPayer�ExpectedBucketOwner)	�CopySourceIfMatch�CopySourceIfModifiedSince�CopySourceIfNoneMatch�CopySourceIfUnmodifiedSince�CopySourceSSECustomerKey�CopySourceSSECustomerAlgorithm�CopySourceSSECustomerKeyMD5rrr
rrrrrrZMetadataDirectiveZTaggingDirectivecCs�|jjdkrn|jj}|�|j�}|j}|��D] \}	}
|	|jkr.|
||j|	<q.|jj	f|�}|j�
|d�|jj|jkr�|�|||||�n|�
|||||�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
        NZ
ContentLength)�meta�size�	call_args�)_get_head_object_request_from_copy_source�copy_source�
extra_args�items�EXTRA_ARGS_TO_HEAD_ARGS_MAPPINGZ
source_clientZhead_objectZprovide_transfer_sizeZmultipart_threshold�_submit_copy_request�_submit_multipart_request)�self�client�config�osutil�request_executor�transfer_futurerZhead_object_requestr�param�value�response�r'�>/opt/cppython/lib/python3.8/site-packages/s3transfer/copies.py�_submitPsD��
������zCopySubmissionTask._submitc
CsL|jj}t|d�}|j�|t|j||j|j|j|j	||jj
d�dd��dS)N�progress)rr�bucket�keyr�	callbacksrT)�transfer_coordinator�main_kwargs�is_final)rrr�_transfer_coordinator�submit�CopyObjectTaskrr+r,rr)rrr r!r"r#r�progress_callbacksr'r'r(r�s"
�	��z'CopySubmissionTask._submit_copy_requestcCsx|jj}i}|j��D]\}}	||jkr|	||<q|j�|t|j||j|j	|d�d��}
|j
}t�}|�||jj
�}tt�|jj
t|���}
g}t|d�}td|
d�D]�}|�|j�}t||d|
|jj
�|d<|�||d|
|jj
�}|j�d�}|�|j�|t|j||j|j|j	|||||d�	d|
id	���q�|�|j�}|j�|t|j||j|j	|d�|
|d
�dd��dS)
N)rr+r,r)r.r/r*�ZCopySourceRangeZChecksumAlgorithm)	rrr+r,�part_numberrr-r�checksum_algorithm�	upload_id)r.r/�pending_main_kwargs)r8�partsT)r.r/r9r0)rrrr�CREATE_MULTIPART_ARGS_BLACKLISTr1r2rr+r,Zmultipart_chunksizerZadjust_chunksizer�int�math�ceil�floatr�range�_extra_upload_part_argsr�_get_transfer_size�get�append�CopyPartTaskr�_extra_complete_multipart_argsr)rrr r!r"r#rZcreate_multipart_extra_argsr$�valZcreate_multipart_future�	part_sizeZadjuster�	num_partsZpart_futuresr4r6Zextra_part_argsrr7Zcomplete_multipart_extra_argsr'r'r(r�s�

�����
�������������z,CopySubmissionTask._submit_multipart_requestcCs2t|t�rt�|�Std|�dt|��d���dS)NzLExpecting dictionary formatted: {"Bucket": bucket_name, "Key": key} but got z	 or type �.)�
isinstance�dict�copy�	TypeError�type)rrr'r'r(rs


�z<CopySubmissionTask._get_head_object_request_from_copy_sourcecCst||j�S�N)r	�UPLOAD_PART_COPY_ARGS�rrr'r'r(rAsz*CopySubmissionTask._extra_upload_part_argscCst||j�SrP)r	�COMPLETE_MULTIPART_ARGSrRr'r'r(rF#sz1CopySubmissionTask._extra_complete_multipart_argscCs||dkr|||S|S)Nr5r')rrHZ
part_indexrIZtotal_transfer_sizer'r'r(rB&sz%CopySubmissionTask._get_transfer_sizeN)�__name__�
__module__�__qualname__�__doc__rrQr;rSr)rrrrArFrBr'r'r'r(r
s^�
��
�>l
r
c@seZdZdZdd�ZdS)r3zTask to do a nonmultipart copyc	Cs0|jf|||d�|��|D]}||d�qdS)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�Zbytes_transferredN)Zcopy_object)	rrrr+r,rr-r�callbackr'r'r(�_main3s��zCopyObjectTask._mainN�rTrUrVrWr]r'r'r'r(r30sr3c@seZdZdZddd�ZdS)rEz)Task to upload a part in a multipart copyNcCsx|jf|||||d�|��}|D]}||	d�q |dd}
|
|d�}|
rtd|
����}||dkrt|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.
        )rXrYrZZUploadId�
PartNumberr[ZCopyPartResult�ETag)r`r_ZChecksum)Zupload_part_copy�upper)rrrr+r,r8r6rr-rr7r&r\�etagZ
part_metadataZchecksum_memberr'r'r(r]Ls(&��
�zCopyPartTask._main)Nr^r'r'r'r(rEIs
�rE)rMr=Zs3transfer.tasksrrrrZs3transfer.utilsrrrr	r
r3rEr'r'r'r(�<module>
s

F1le Man4ger