HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/s3/__pycache__/transferconfig.cpython-36.pyc
3

�T_��@s`ddlmZddlmZddlmZddddd	d
�ZGdd�de�ZGd
d�de	�Z
dd�Zd	S)�)�TransferConfig)�human_readable_to_bytes)�six�i��
i�N)�multipart_threshold�multipart_chunksize�max_concurrent_requests�max_queue_size�
max_bandwidthc@seZdZdS)�InvalidConfigErrorN)�__name__�
__module__�__qualname__�rr�$/usr/lib/python3.6/transferconfig.pyr
sr
c@s\eZdZdddddgZddgZdgZedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�
RuntimeConfigr	rr
rrcCstj�S)N)�DEFAULTS�copyrrrr�defaults)szRuntimeConfig.defaultscKs8tj�}|r|j|�|j|�|j|�|j|�|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@x:|jD]0}|j|�}|dk	rt|tj�rt|�||<qWdS)N)�HUMAN_READABLE_SIZES�get�
isinstancer�
integer_typesr)rr�attr�valuerrrr@s
z+RuntimeConfig._convert_human_readable_sizescCs^xX|jD]N}|j|�}|dk	rt|tj�r|jd�sBtd|��t|dd��||<qWdS)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)r���)�HUMAN_READABLE_RATESr r!rr"�endswithr
r)rrr#r$rrrrFs

z+RuntimeConfig._convert_human_readable_ratescCspxj|jD]`}|j|�}|dk	ry(t|�||<||dksD|j||�Wqtk
rf|j||�YqXqWdS)Nr)�POSITIVE_INTEGERSr �int�_error_positive_value�
ValueError)rrr#r$rrrrQs
zRuntimeConfig._validate_configcCstd||f��dS)Nz+Value for %s must be a positive integer: %s)r
)r�namer$rrrr*\sz#RuntimeConfig._error_positive_valueN)
rrrr(rr&�staticmethodrrrrrr*rrrrr!srcCsJdddddd�}i}x*|j�D]\}}||kr0q||||<qWtf|�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_sizerr	r)r
rrr	r)�itemsr)rZtranslation_mapr�keyr$rrr�*create_transfer_config_from_runtime_configasr0ii�ii�)Zs3transfer.managerrZawscli.customizations.s3.utilsrZ
awscli.compatrr�	Exceptionr
�objectrr0rrrr�<module>
s@