Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
measure.cpython-313.pyc76 linesDownload Raw Back to __pycache__
1�

2�j����SSKJr SSKJrJrJrJrJr SSKJ	r	 SSK3JrJr \(a4SSK
JrJrJr "SS\5rS	S5SSS
\SSS4Sjrg)�)�6itemgetter)�
TYPE_CHECKING�Callable�7NamedTuple�Optional�Sequence�)�errors)�
is_renderable�	rich_cast)�Console�ConsoleOptions�RenderableTypec���\rSrSr%Sr\\S'\\S'\S\4Sj5rSSjr	S\SS4S	jr8S\SS4S9jrSS\\S
\\SS4Sjjr
\SSj5rSrg)�Measurement�zSStores the minimum and maximum widths (in characters) required to render an object.�minimum�maximum�returnc�4�URUR-10$)z+Get difference between maximum and minimum.)rr)�selfs �RD:\code\apps\devtools\python\user_packages\Python313\site-packages\rich/measure.py�span�Measurement.spans���|�|�d�l�l�*�*�c11��Uup[[SU5U5n[[SU5[S[X555$)z{Get measurement that ensures that minimum <= maximum and minimum >= 012 13Returns:14    Measurement: A normalized measurement.15r)�min�maxr)rrrs   r�	normalize�Measurement.normalizes=�� ����c�!�W�o�w�/���3�q�'�?�C��3�w�3H�,I�J�Jr�widthc�F�Uup#[[X!5[X155$)z�Get a RenderableWith where the widths are <= width.16 17Args:18    width (int): Maximum desired width.19 20Returns:21    Measurement: New Measurement object.22)rr�rr!rrs    r�with_maximum�Measurement.with_maximum"s#�� ����3�w�.��G�0C�D�Drc�^�Uup#[SU5n[[X!5[X155$)z�Get a RenderableWith where the widths are >= width.23 24Args:25    width (int): Minimum desired width.26 27Returns:28    Measurement: New Measurement object.29r)rrr#s    r�with_minimum�Measurement.with_minimum.s.�� ����A�u�
���3�w�.��G�0C�D�DrN�	min_width�	max_widthc�Z�UnUbURU5nUbURU5nU$)aClamp a measurement within the specified range.30 31Args:32    min_width (int): Minimum desired width, or ``None`` for no minimum. Defaults to None.33    max_width (int): Maximum desired width, or ``None`` for no maximum. Defaults to None.34 35Returns:36    Measurement: New Measurement object.37)r'r$)rr)r*�measurements    r�clamp�Measurement.clamp;s;����� �%�2�2�9�=�K�� �%�2�2�9�=�K��rc���URnUS:a[SS5$[U[5(aUR	X2R38SS9n[
U5n[U5(am[USS5nUbQU"X5R5RU5nURS:a[SS5$UR5$[SU5$[R"SU<S35e)	a�Get a measurement for a renderable.39 40Args:41    console (~rich.console.Console): Console instance.42    options (~rich.console.ConsoleOptions): Console options.43    renderable (RenderableType): An object that may be rendered with Rich.44 45Raises:46    errors.NotRenderableError: If the object is not renderable.47 48Returns:49    Measurement: Measurement object containing range of character widths required to render the object.50r	rF)�markup�	highlight�__rich_measure__NzUnable to get render width for zD; a str, Segment, or object with __rich_console__ method is required)r*r�51isinstance�str�52render_strr0rr�getattrrr$rr53�NotRenderableError)�cls�console�options�54renderable�55_max_width�get_console_width�render_widths       r�get�Measurement.getNs���"�&�&�56���>��q�!�$�$��j�#�&�&� �+�+��>�>�U�,��J��z�*�57���$�$��58�$6��=�
�!�,�%�g�7��Y�[�!�\�*�-��59 �'�'�!�+�&�q�!�,�,�#�-�-�/�/�"�1�j�1�1��+�+�1�*��@U�U��
r�)rr)NN)r9r
r:rr;rrr)�__name__�60__module__�__qualname__�__firstlineno__�__doc__�int�__annotations__�propertyrrr$r'rr-�classmethodr?�__static_attributes__rArrrrs���]�
�L�5�
�L�5�
�+�c�+��+�K�61E�#�62E�-�63E�E�#�E�-�E�KO��!�#���:B�3�-��	��&�+��+�*:�+�HX�+�	�+��+rrr9r
r:r�renderablesrrc	�64�U(d[SS5$[RnUVs/sHoC"XU5PM
 nn[[U[S5S9R[U[S5S9R655nU$s snf)a�Get a measurement that would fit a number of renderables.66 67Args:68    console (~rich.console.Console): Console instance.69    options (~rich.console.ConsoleOptions): Console options.70    renderables (Iterable[RenderableType]): One or more renderable objects.71 72Returns:73    Measurement: Measurement object containing range of character widths required to74        contain all given renderables.75r)�keyr	)rr?rrrr)r9r:rL�get_measurementr;�measurements�measured_widths       r�measure_renderablesrR}s��� ��1�a� � �!�o�o�O�HS��HS�*���*�5����!��L�j��m�,�4�4��L�j��m�,�4�4��N����s�BN)�operatorr�typingrrrrr�r76�protocolrrr9r
rrrrRrArr�<module>rWs[���J�J��.��@�@�o�*�o�d�
��
���*�+���	r
codekingpro/portable-devtools · Team Ai