Files
ServerSync/lib/rich/__pycache__/filesize.cpython-314.pyc

44 lines
3.6 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
<00> <0C>i<EFBFBD> <00><00>d<00>RtR.t^RIHtHtHtHtR^RR/RRlltRR ltR^RR/R
R llt R #) 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>`_
<EFBFBD>decimal)<04>Iterable<6C>List<73>Optional<61>Tuple<6C> precision<6F> separator<6F> c <00><><00>V^8<>dQhR\R\\,R\R\\,R\\,R\/#)<07><00>size<7A>suffixes<65>baserr<00>return)<04>intr<00>strr)<01>formats"<22>4/tmp/pip-target-qd_sq_1j/lib/python/rich/filesize.py<70> __annotate__rsP<00><00><06><06>
<0A><06><16>s<EFBFBD>m<EFBFBD><06> <0E><06>
<18><03>}<7D> <06> <18><03>}<7D> <06> <09><06>c<00><><00>V^8XdR#W8dVR R2#\V^4FwrVW%,pW8gKM RPW ,X, XVVR7#)<06>z1 byte<74>,z bytesz{:,.{precision}f}{separator}{}<7D>rr)<02> enumerater)r r rrr<00>i<>suffix<69>units&&&$$ r<00>_to_strrsq<00><00> <0C>q<EFBFBD>y<EFBFBD><17> <0A><1B><16>q<EFBFBD><18><16> <20> <20><1E>x<EFBFBD><11>+<2B> <09><01><13>w<EFBFBD><04> <0F>;<3B> <11>,<2C> ,<2C> 2<> 2<> <0A><1B>t<EFBFBD> <1B><0E><1B><1B> 3<> <06>rc
<00><><00>V^8<>dQhR\R\\,R\R\\\3,/#)r r r rr)rrrr)rs"rrr+s5<00><00><18><18>s<EFBFBD><18>d<EFBFBD>3<EFBFBD>i<EFBFBD><18>s<EFBFBD><18>u<EFBFBD>S<EFBFBD>RU<52>X<EFBFBD><EFBFBD>rc<04>d<00>\V4Fwr4W#,pWV,8gKWT3# XX3#)z*Pick a suffix and base for the given size.)r)r r rrrrs&&& r<00>pick_unit_and_suffixr!+s;<00><00><1E>x<EFBFBD>(<28> <09><01><13>w<EFBFBD><04> <0F><14>+<2B> <1D> <11> <0F><<3C><17> )<29> <10><16><<3C>rc<00>t<00>V^8<>dQhR\R\\,R\\,R\/#)r r rrr)rrr)rs"rrr4s:<00><00>$<06>$<06>
<0A>$<06><18><03>}<7D>$<06><18><03>}<7D> $<06>
 <09> $rc<04>"<00>\VRRVVR7#)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.
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'
i<EFBFBD>r)<08>kB<6B>MB<4D>GB<47>TB<54>PB<50>EB<45>ZB<5A>YB)r)r rrs&$$rrr4s <00><00>< <13> <0C>8<> <0C><1B><1B>  <06>rN)
<EFBFBD>__doc__<5F>__all__<5F>typingrrrrrr!r<00>rr<00><module>r0sU<00><01>
<04> <15>+<2B><07>2<>2<><06>
!<21> <06> #<23> <06>2<18>$<06> !<21>$<06> #<23> $<06>$r