PATH:
opt
/
alt
/
python38
/
lib
/
python3.8
/
site-packages
/
pip
/
_vendor
/
rich
/
__pycache__
U ʗRe� � @ s� d Z dgZddlmZmZmZmZ ddd�eee eee ee ed�dd �Z eee eeeef d �dd�Z ddd�eee ee ed �dd�ZdS )a� Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2 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>`_ �decimal� )�Iterable�List�Optional�Tuple� � �� precision� separator)�size�suffixes�baser r �returnc C s` | dkrdS | |k rd� | �S t|d�D ]\}}|| }| |k r( qFq(dj || | |||d�S )Nr z1 bytez {:,} bytes� z{:,.{precision}f}{separator}{}r )�format� enumerate)r r r r r �i�suffix�unit� r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/rich/filesize.py�_to_str s �r )r r r r c C s2 t |�D ] \}}|| }| || k r q*q||fS )z*Pick a suffix and base for the given size.)r )r r r r r r r r r �pick_unit_and_suffix, s r )r r r r c C s t | dd||d�S )a3 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. 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 r r r r r r 5 s �N)�__doc__�__all__�typingr r r r �int�strr r r r r r r �<module> s* �� ��
[-] default_styles.cpython-38.pyc
[edit]
[-] ansi.cpython-38.pyc
[edit]
[-] _ratio.cpython-38.pyc
[edit]
[-] repr.cpython-38.pyc
[edit]
[-] _loop.cpython-38.pyc
[edit]
[-] _export_format.cpython-38.pyc
[edit]
[-] styled.cpython-38.pyc
[edit]
[-] _windows.cpython-38.pyc
[edit]
[-] file_proxy.cpython-38.pyc
[edit]
[-] palette.cpython-38.pyc
[edit]
[-] containers.cpython-38.pyc
[edit]
[-] progress_bar.cpython-38.pyc
[edit]
[-] table.cpython-38.pyc
[edit]
[-] live.cpython-38.pyc
[edit]
[-] scope.cpython-38.pyc
[edit]
[-] _timer.cpython-38.pyc
[edit]
[-] text.cpython-38.pyc
[edit]
[-] spinner.cpython-38.pyc
[edit]
[-] syntax.cpython-38.pyc
[edit]
[-] rule.cpython-38.pyc
[edit]
[-] tree.cpython-38.pyc
[edit]
[-] themes.cpython-38.pyc
[edit]
[-] layout.cpython-38.pyc
[edit]
[-] _win32_console.cpython-38.pyc
[edit]
[-] highlighter.cpython-38.pyc
[edit]
[-] control.cpython-38.pyc
[edit]
[-] _pick.cpython-38.pyc
[edit]
[-] abc.cpython-38.pyc
[edit]
[-] segment.cpython-38.pyc
[edit]
[-] screen.cpython-38.pyc
[edit]
[-] cells.cpython-38.pyc
[edit]
[-] color_triplet.cpython-38.pyc
[edit]
[-] status.cpython-38.pyc
[edit]
[+]
..
[-] style.cpython-38.pyc
[edit]
[-] _inspect.cpython-38.pyc
[edit]
[-] protocol.cpython-38.pyc
[edit]
[-] bar.cpython-38.pyc
[edit]
[-] jupyter.cpython-38.pyc
[edit]
[-] columns.cpython-38.pyc
[edit]
[-] errors.cpython-38.pyc
[edit]
[-] live_render.cpython-38.pyc
[edit]
[-] align.cpython-38.pyc
[edit]
[-] console.cpython-38.pyc
[edit]
[-] prompt.cpython-38.pyc
[edit]
[-] color.cpython-38.pyc
[edit]
[-] _cell_widths.cpython-38.pyc
[edit]
[-] __init__.cpython-38.pyc
[edit]
[-] _spinners.cpython-38.pyc
[edit]
[-] measure.cpython-38.pyc
[edit]
[-] _stack.cpython-38.pyc
[edit]
[-] _extension.cpython-38.pyc
[edit]
[-] logging.cpython-38.pyc
[edit]
[-] filesize.cpython-38.pyc
[edit]
[-] box.cpython-38.pyc
[edit]
[-] markup.cpython-38.pyc
[edit]
[-] __main__.cpython-38.pyc
[edit]
[-] theme.cpython-38.pyc
[edit]
[-] json.cpython-38.pyc
[edit]
[-] constrain.cpython-38.pyc
[edit]
[-] pager.cpython-38.pyc
[edit]
[-] _log_render.cpython-38.pyc
[edit]
[-] panel.cpython-38.pyc
[edit]
[-] _windows_renderer.cpython-38.pyc
[edit]
[-] emoji.cpython-38.pyc
[edit]
[-] region.cpython-38.pyc
[edit]
[-] _emoji_replace.cpython-38.pyc
[edit]
[-] progress.cpython-38.pyc
[edit]
[-] pretty.cpython-38.pyc
[edit]
[-] _emoji_codes.cpython-38.pyc
[edit]
[-] diagnose.cpython-38.pyc
[edit]
[-] padding.cpython-38.pyc
[edit]
[-] _palettes.cpython-38.pyc
[edit]
[-] traceback.cpython-38.pyc
[edit]
[-] terminal_theme.cpython-38.pyc
[edit]
[-] _wrap.cpython-38.pyc
[edit]