Files
tamigo-cli/venv/lib/python3.12/site-packages/rich/__pycache__/measure.cpython-312.pyc

76 lines
6.2 KiB
Plaintext
Raw Normal View History

<EFBFBD>
<00><16>i<EFBFBD><00><00><><00>ddlmZddlmZmZmZmZmZddlm Z ddl
m Z m Z er
ddl mZmZmZGd<07>de<05>Zd d
d d d edddfd<10>Zy)<12>)<01>
itemgetter)<05> TYPE_CHECKING<4E>Callable<6C>
NamedTuple<EFBFBD>Optional<61>Sequence<63>)<01>errors)<02> is_renderable<6C> rich_cast)<03>Console<6C>ConsoleOptions<6E>RenderableTypec<00><><00>eZdZUdZeed< eed< edefd<05><04>Zdd<06>Zdeddfd<08>Z deddfd <09>Z
dd e ed e eddfd <0A>Z e dd<0E><04>Zy
)<12> MeasurementzSStores the minimum and maximum widths (in characters) required to render an object.<2E>minimum<75>maximum<75>returnc<00>4<00>|j|jz
S)z+Get difference between maximum and minimum.)rr)<01>selfs <20>R/home/daniel/Projects/tamigo-cli/venv/lib/python3.12/site-packages/rich/measure.py<70>spanzMeasurement.spans<00><00><14>|<7C>|<7C>d<EFBFBD>l<EFBFBD>l<EFBFBD>*<2A>*<2A>c
<00><><00>|\}}ttd|<01>|<02>}ttd|<01>tdt||<02><00><00>S)z<>Get measurement that ensures that minimum <= maximum and minimum >= 0
Returns:
Measurement: A normalized measurement.
r)<03>min<69>maxr)rrrs r<00> normalizezMeasurement.normalizesA<00><00>  <20><18><07><17><15>c<EFBFBD>!<21>W<EFBFBD>o<EFBFBD>w<EFBFBD>/<2F><07><1A>3<EFBFBD>q<EFBFBD>'<27>?<3F>C<EFBFBD><01>3<EFBFBD>w<EFBFBD><07>3H<33>,I<>J<>Jr<00>widthc<00>L<00>|\}}tt||<01>t||<01><00>S)z<>Get a RenderableWith where the widths are <= width.
Args:
width (int): Maximum desired width.
Returns:
Measurement: New Measurement object.
)rr<00>rrrrs r<00> with_maximumzMeasurement.with_maximum"s)<00><00> <20><18><07><17><1A>3<EFBFBD>w<EFBFBD><05>.<2E><03>G<EFBFBD>U<EFBFBD>0C<30>D<>Drc<00>d<00>|\}}td|<01>}tt||<01>t||<01><00>S)z<>Get a RenderableWith where the widths are >= width.
Args:
width (int): Minimum desired width.
Returns:
Measurement: New Measurement object.
r)rrr s r<00> with_minimumzMeasurement.with_minimum.s4<00><00> <20><18><07><17><13>A<EFBFBD>u<EFBFBD> <0A><05><1A>3<EFBFBD>w<EFBFBD><05>.<2E><03>G<EFBFBD>U<EFBFBD>0C<30>D<>DrN<> min_width<74> max_widthc<00>V<00>|}|<01>|j|<01>}|<02>|j|<02>}|S)aNClamp a measurement within the specified range.
Args:
min_width (int): Minimum desired width, or ``None`` for no minimum. Defaults to None.
max_width (int): Maximum desired width, or ``None`` for no maximum. Defaults to None.
Returns:
Measurement: New Measurement object.
)r#r!)rr$r%<00> measurements r<00>clampzMeasurement.clamp;s;<00><00><1B> <0B> <14> <20>%<25>2<>2<>9<EFBFBD>=<3D>K<EFBFBD> <14> <20>%<25>2<>2<>9<EFBFBD>=<3D>K<EFBFBD><1A>rc<00><><00>|j}|dkr tdd<02>St|t<00>r|j ||j
d<03><04>}t |<03>}t|<03>rlt|dd<06>}|<05>Q|||<02>j<00>j|<04>}|jdkr tdd<02>S|j<00>Std|<04>Stjd|<03>d<08><03><00>) a<>Get a measurement for a renderable.
Args:
console (~rich.console.Console): Console instance.
options (~rich.console.ConsoleOptions): Console options.
renderable (RenderableType): An object that may be rendered with Rich.
Raises:
errors.NotRenderableError: If the object is not renderable.
Returns:
Measurement: Measurement object containing range of character widths required to render the object.
r rF)<02>markup<75> highlight<68>__rich_measure__NzUnable to get render width for zD; a str, Segment, or object with __rich_console__ method is required)r%r<00>
isinstance<EFBFBD>str<74>
render_strr*r r <00>getattrrr!rr
<00>NotRenderableError)<07>cls<6C>console<6C>options<6E>
renderable<EFBFBD>
_max_width<EFBFBD>get_console_width<74> render_widths r<00>getzMeasurement.getNs<><00><00>"<1D>&<26>&<26>
<EFBFBD> <15><01>><3E><1E>q<EFBFBD>!<21>$<24> $<24> <15>j<EFBFBD>#<23> &<26> <20>+<2B>+<2B><1A>7<EFBFBD>><3E>><3E>U<EFBFBD>,<2C><0E>J<EFBFBD><1F>z<EFBFBD>*<2A>
<EFBFBD> <18><1A> $<24><18>
<EFBFBD>$6<><04>=<3D> <1E>!<21>,<2C>%<25>g<EFBFBD>w<EFBFBD>7<><1E>Y<EFBFBD>[<5B>!<21>\<5C>*<2A>-<2D><1D>
 <20>'<27>'<27>!<21>+<2B>&<26>q<EFBFBD>!<21>,<2C>,<2C>#<23>-<2D>-<2D>/<2F>/<2F>"<22>1<EFBFBD>j<EFBFBD>1<>1<><18>+<2B>+<2B>1<>*<2A><1E>@U<01>U<01><0E> r)rr)NN)r3r r4rr5rrr)<0F>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>int<6E>__annotations__<5F>propertyrrr!r#rr(<00> classmethodr9<00>rrrr s<><00><00>]<5D> <10>L<EFBFBD>5<> <10>L<EFBFBD>5<> <0A>+<2B>c<EFBFBD>+<2B><0E>+<2B>K<01>
E<01>#<23>
E<01>-<2D>
E<01> E<01>#<23> E<01>-<2D> E<01>KO<01><1B>!<21>#<23><1D><1B>:B<>3<EFBFBD>-<2D><1B> <16><1B>&<11>+<0E><1F>+<0E>*:<3A>+<0E>HX<48>+<0E> <16>+<0E><11>+rrr3r r4r<00> renderablesrrc <00>
<00>|s tdd<01>Stj}|D<00>cgc] }||||<04><00><02>}}tt|td<01><00><02>jt|td<03><00><02>j
<00>}|Scc}w)a<>Get a measurement that would fit a number of renderables.
Args:
console (~rich.console.Console): Console instance.
options (~rich.console.ConsoleOptions): Console options.
renderables (Iterable[RenderableType]): One or more renderable objects.
Returns:
Measurement: Measurement object containing range of character widths required to
contain all given renderables.
r)<01>keyr )rr9rrrr)r3r4rC<00>get_measurementr5<00> measurements<74>measured_widths r<00>measure_renderablesrI}s<><00><00> <17><1A>1<EFBFBD>a<EFBFBD> <20> <20>!<21>o<EFBFBD>o<EFBFBD>O<EFBFBD>HS<48><06>:D<><0F><07><17>*<2A>5<><06>L<EFBFBD><06>!<21> <0B>L<EFBFBD>j<EFBFBD><11>m<EFBFBD>,<2C>4<>4<> <0B>L<EFBFBD>j<EFBFBD><11>m<EFBFBD>,<2C>4<>4<><06>N<EFBFBD> <1A><19><>s<00>BN)<13>operatorr<00>typingrrrrr<00>r
<00>protocolr r r3r rrrrIrBrr<00><module>rNs[<00><01><1F>J<>J<><14>.<2E><10>@<40>@<40>o<0E>*<2A>o<0E>d<1A> <16><1A> <1D><1A><1A>*<2A>+<2B><1A><13> r