HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/s3/__pycache__/transferconfig.cpython-38.pyc
U

<�^��@s`ddlmZddlmZddlmZdddddd�ZGd	d
�d
e�ZGdd�de	�Z
d
d�ZdS)�)�TransferConfig)�human_readable_to_bytes)�sixi��
i�N)�multipart_threshold�multipart_chunksize�max_concurrent_requests�max_queue_size�
max_bandwidthc@seZdZdS)�InvalidConfigErrorN)�__name__�
__module__�__qualname__�rr�I/usr/lib/python3/dist-packages/awscli/customizations/s3/transferconfig.pyrsrc@s\eZdZdddddgZddgZdgZedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�
RuntimeConfigrrrr	r
cCst��S�N)�DEFAULTS�copyrrrr�defaults)szRuntimeConfig.defaultscKs8t��}|r|�|�|�|�|�|�|�|�|S)ajCreate and convert a runtime config dictionary.

        This method will merge and convert S3 runtime configuration
        data into a single dictionary that can then be passed to classes
        that use this runtime config.

        :param kwargs:  Any key in the ``DEFAULTS`` dict.
        :return: A dictionary of the merged and converted values.

        )rr�update�_convert_human_readable_sizes�_convert_human_readable_rates�_validate_config)�self�kwargs�runtime_configrrr�build_config-s



zRuntimeConfig.build_configcCs:|jD].}|�|�}|dk	rt|tj�st|�||<qdSr)�HUMAN_READABLE_SIZES�get�
isinstancer�
integer_typesr�rr�attr�valuerrrr@s

z+RuntimeConfig._convert_human_readable_sizescCsX|jD]L}|�|�}|dk	rt|tj�s|�d�s>td|��t|dd��||<qdS)NzB/sznInvalid rate: %s. The value must be expressed as a rate in terms of bytes per seconds (e.g. 10MB/s or 800KB/s)���)�HUMAN_READABLE_RATESrr rr!�endswithrrr"rrrrFs


��z+RuntimeConfig._convert_human_readable_ratesc	Csl|jD]`}|�|�}|dk	rz(t|�||<||dksB|�||�Wqtk
rd|�||�YqXqdS)Nr)�POSITIVE_INTEGERSr�int�_error_positive_value�
ValueErrorr"rrrrQs

zRuntimeConfig._validate_configcCstd||f��dS)Nz+Value for %s must be a positive integer: %s)r)r�namer$rrrr*\s
�z#RuntimeConfig._error_positive_valueN)
rr
rr(rr&�staticmethodrrrrrr*rrrrr!s�
rcCsFdddddd�}i}|��D]\}}||kr.q||||<qtf|�S)z�
    Creates an equivalent s3transfer TransferConfig

    :type runtime_config: dict
    :argument runtime_config: A valid RuntimeConfig-generated dict.

    :returns: A TransferConfig with the same configuration as the runtime
        config.
    Zmax_request_concurrencyZmax_request_queue_sizerrr
)rr	rrr
)�itemsr)rZtranslation_mapr�keyr$rrr�*create_transfer_config_from_runtime_configas�r0)Zs3transfer.managerrZawscli.customizations.s3.utilsrZ
awscli.compatrr�	Exceptionr�objectrr0rrrr�<module>
s�	@