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: //opt/saltstack/salt/lib/python3.10/site-packages/rich/__pycache__/filesize.cpython-310.pyc
o

;j�	�
@s�dZdgZddlmZmZmZmZddd�dedeed	ed
eedeedefd
d�Z	dedeed	edeeeffdd�Z
ddd�ded
eedeedefdd�ZdS)a�Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2

The functions declared in this module should cover the different
use cases needed to generate a string representation of a file size
using several different units. Since there are many standards regarding
file size units, three different functions have been implemented.

See Also:
    * `Wikipedia: Binary prefix <https://en.wikipedia.org/wiki/Binary_prefix>`_

�decimal�)�Iterable�List�Optional�Tuple�� ��	precision�	separator�size�suffixes�baser
r�returncCsb|dkrdS||kr|d�d�St|d�D]\}}||}||kr#nqdj||||||d�S)Nrz1 byte�,z bytes�z{:,.{precision}f}{separator}{}r	)�	enumerate�format)rr
rr
r�i�suffix�unit�r�A/opt/saltstack/salt/lib/python3.10/site-packages/rich/filesize.py�_to_strs�
�rcCs8t|�D]\}}||}|||kr||fSq||fS)z*Pick a suffix and base for the given size.)r)rr
rrrrrrr�pick_unit_and_suffix+s�rcCst|dd||d�S)a3Convert a filesize in to a string (powers of 1000, SI prefixes).

    In this convention, ``1000 B = 1 kB``.

    This is typically the format used to advertise the storage
    capacity of USB flash drives and the like (*256 MB* meaning
    actually a storage capacity of more than *256 000 000 B*),
    or used by **Mac OS X** since v10.6 to report file sizes.

    Arguments:
        int (size): A file size.
        int (precision): The number of decimal places to include (default = 1).
        str (separator): The string to separate the value from the units (default = " ").

    Returns:
        `str`: A string containing a abbreviated file size and units.

    Example:
        >>> filesize.decimal(30000)
        '30.0 kB'
        >>> filesize.decimal(30000, precision=2, separator="")
        '30.00kB'

    )ZkBZMBZGBZTBZPBZEBZZBZYBi�r	)r)rr
rrrrr4s�N)�__doc__�__all__�typingrrrr�int�strrrrrrrr�<module>s<������
�&�����