HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/s3/__pycache__/transferconfig.cpython-310.pyc
o

.&�a��@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@sVeZdZgd�ZddgZdgZedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�ZdS)�
RuntimeConfig)rrrr	r
rrr
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]}|�|�}|durt|tj�st|�||<qdSr)�HUMAN_READABLE_SIZES�get�
isinstancer�
integer_typesr�rr�attr�valuerrrr@s

��z+RuntimeConfig._convert_human_readable_sizescCsX|jD]&}|�|�}|dur)t|tj�s)|�d�std|��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	Csj|jD]/}|�|�}|dur2zt|�||<||dks!|�||�Wqty1|�||�YqwqdS)Nr)�POSITIVE_INTEGERSr�int�_error_positive_value�
ValueErrorr"rrrrQs

����zRuntimeConfig._validate_configcCstd||f��)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
rcCsJdddddd�}i}|��D]\}}||vrq||||<qtdi|��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.
    �max_request_concurrency�max_request_queue_sizerrr
)rr	rrr
Nr)�itemsr)r�translation_mapr�keyr$rrr�*create_transfer_config_from_runtime_configas�r3)�s3transfer.managerr�awscli.customizations.s3.utilsr�
awscli.compatrr�	Exceptionr�objectrr3rrrr�<module>s�	@