HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/rich/__pycache__/filesize.cpython-311.pyc
�

�;f�	�
���dZdgZddlmZmZmZmZddd�dedeed	ed
eedeedefd
�Z	dedeed	edeeeffd�Z
ddd�ded
eedeedefd�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�baserr�returnc���|dkrdS||krd�|��St|d��D]\}}||z}||krn�d�||z|z|||���S)Nrz1 bytez
{:,} bytes�z{:,.{precision}f}{separator}{}r
)�format�	enumerate)r
rrrr�i�suffix�units        �@/opt/alt/python311/lib/python3.11/site-packages/rich/filesize.py�_to_strrs����q�y�y��x�	
�����"�"�4�(�(�(��x��+�+���	��6��Q�w���$�;�;��E��+�2�2�	
���t�	����	3����c�T�t|��D]\}}||z}|||zkrn�||fS)z*Pick a suffix and base for the given size.)r)r
rrrrrs      r�pick_unit_and_suffixr,sI���x�(�(���	��6��Q�w���$��+����E����<�rc�*�t|dd||���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'

    )�kB�MB�GB�TB�PB�EB�ZB�YBi�r
)r)r
rrs   rrr5s*��<��8�������rN)�__doc__�__all__�typingrrrr�int�strrrr�rr�<module>r,sA��
�
��+��2�2�2�2�2�2�2�2�2�2�2�2� !�"�
���

���s�m����
��}����}�
�	�����2�s��d�3�i��s��u�S�RU�X������ !�"�	$�$�$�

�$���}�$���}�	$�
	�$�$�$�$�$�$r