$64 GRAYBYTE WORDPRESS FILE MANAGER $96

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 88.222.243.92 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python311/lib/python3.11/site-packages/rich/__pycache__/

HOME
Current File : /opt/alt/python311/lib/python3.11/site-packages/rich/__pycache__//segment.cpython-311.pyc
�

��;f�^��D�ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZmZmZmZmZddlmZmZmZmZmZdd	lmZmZdd
lmZer
ddl m!Z!m"Z"m#Z#ed��Z$Gd
�de��Z%eee%ee%ee&e'ffee%e&e&ffZ(e��Gd�de����Z)Gd�d��Z*Gd�d��Z+e,dk�r?ddl-m!Z!ddl.m/Z/ddl0m1Z1dZ2e1j3d��Z4e!��Z e �5d��e �6d��e �6d��e �6e/e2dd� ����e �6��e �6d!��e7e �8e4����Z9e �6e9��e �6��e �6d"��e �6e4��e �6d#��d$Sd$S)%�)�IntEnum)�	lru_cache)�filterfalse)�	getLogger)�
attrgetter)
�
TYPE_CHECKING�Dict�Iterable�List�
NamedTuple�Optional�Sequence�Tuple�Type�Union�)�_is_single_cell_widths�cached_cell_len�cell_len�get_character_cell_size�
set_cell_size)�Result�	rich_repr)�Style)�Console�ConsoleOptions�RenderResult�richc�R�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdS)�ControlTypezDNon-printable control codes which typically translate to ANSI codes.r��������	�
���
���N)�__name__�
__module__�__qualname__�__doc__�BELL�CARRIAGE_RETURN�HOME�CLEAR�SHOW_CURSOR�HIDE_CURSOR�ENABLE_ALT_SCREEN�DISABLE_ALT_SCREEN�	CURSOR_UP�CURSOR_DOWN�CURSOR_FORWARD�CURSOR_BACKWARD�CURSOR_MOVE_TO_COLUMN�CURSOR_MOVE_TO�
ERASE_IN_LINE�SET_WINDOW_TITLE���?/opt/alt/python311/lib/python3.11/site-packages/rich/segment.pyr r #sj������N�N��D��O��D�
�E��K��K������I��K��N��O����N��M����rEr c�X�eZdZUdZeed<dZeeed<dZ	ee
eed<ede
fd���Zdefd�Zdefd	�Zedefd
���Zeed��ddd
e
dedfd�����Zd
e
dedfd�Zed1d���Ze		d2deddeedeededfd���Ze	d3deddededfd���Zededdeedfd���Ze			d4dedde
deedededeedfd���Ze		d5dedde
deedededf
d���Z ededde
fd ���Z!ed!eeddee
e
ffd"���Z"e			d6d!eedd#e
d$ee
deed%edeedfd&���Z#e	d3d'e$dd!eedd#e
d$e
ded%edeedfd(���Z%e	d3d'e$dd!eedd#e
d$e
ded%edeedfd)���Z&e	d3d'e$dd!eedd#e
d$e
ded%edeedfd*���Z'ededdedfd+���Z(ededdedfd,���Z)ededdedfd-���Z*ededdedfd.���Z+ededd/ee
deedfd0���Z,dS)7�Segmenta�A piece of text with associated style. Segments are produced by the Console render process and
    are ultimately converted in to strings to be written to the terminal.

    Args:
        text (str): A piece of text.
        style (:class:`~rich.style.Style`, optional): An optional style to apply to the text.
        control (Tuple[ControlCode], optional): Optional sequence of control codes.

    Attributes:
        cell_length (int): The cell length of this Segment.
    �textN�style�control�returnc�4�|\}}}|rdnt|��S)zzThe number of terminal cells required to display self.text.

        Returns:
            int: A number of cells.
        r)r)�selfrI�_stylerKs    rF�cell_lengthzSegment.cell_lengthQs%��!%���f�g��/�q�q��$���/rEc#�vK�|jV�|j�|j�|jV�dSdS|jV�|jV�dS�N)rIrKrJ�rNs rF�
__rich_repr__zSegment.__rich_repr__[sa�����i�����<���z�%��j� � � � � �&�%��*�����,�����rEc�*�t|j��S)z#Check if the segment contains text.)�boolrIrSs rF�__bool__zSegment.__bool__ds���D�I���rEc��|jduS)z,Check if the segment contains control codes.N)rKrSs rF�
is_controlzSegment.is_controlhs���|�4�'�'rEi@�segment�cut)rHrHc��|\}}}t}|j}||kr||d||��fSt}t||zt	|��dz
z��}	|d|	�}
t|
��}||kr"||
||��|||	d�||��fS|	t	|��kr�||	}|	dz
}	|||��z
}|d|	�}
||kr"||
||��|||	d�||��fS||kr3||
d|	dz
�dz||��|d||	d�z||��fS|	t	|��k��t
d���)N�r� zWill never reach here)rHrPr�int�lenr�AssertionError)
�clsrZr[rIrJrK�_SegmentrP�	cell_size�pos�before�cell_pos�chars
             rF�_split_cellszSegment._split_cellsms��� '���e�W����)���+����H�H�R���8�8�8�8�+�	��3��$��T���Q��7�8�8���d�s�d����F�#�#���s�?�?������0�0����c�d�d��U�G�4�4��
��C��I�I�o�o���9�D��1�H�C��	�	�$���'�H��$�3�$�Z�F��3����H�V�U�G�4�4��H�T�#�$�$�Z���8�8����#�~�~��H�V�I�c�A�g�I�.��4�e�W�E�E��H�S�4����:�-�u�g�>�>����C��I�I�o�o� �4�5�5�5rEc��|\}}}t|��rX|t|��kr|td||��fSt|d|�||��t||d�||��fS|�||��S)a0Split segment in to two segments at the specified column.

        If the cut point falls in the middle of a 2-cell wide character then it is replaced
        by two spaces, to preserve the display width of the parent segment.

        Returns:
            Tuple[Segment, Segment]: Two segments.
        r]N)rr`rHri)rNr[rIrJrKs     rF�split_cellszSegment.split_cells�s��� $���e�W�!�$�'�'�	��c�$�i�i����W�R���8�8�8�8���T�c�T�
�E�7�3�3���S�T�T�
�E�7�3�3��
�
� � ��s�+�+�+rEc��|d��S)zMake a new line segment.�
rD)rbs rF�linezSegment.line�s���s�4�y�y�rE�segments�
post_stylec�b����|}|r|j���fd�|D��}�r��fd�|D��}|S)aApply style(s) to an iterable of segments.

        Returns an iterable of segments where the style is replaced by ``style + segment.style + post_style``.

        Args:
            segments (Iterable[Segment]): Segments to process.
            style (Style, optional): Base style. Defaults to None.
            post_style (Style, optional): Style to apply on top of segment style. Defaults to None.

        Returns:
            Iterable[Segments]: A new iterable of segments (possibly the same iterable).
        c3�T�K�|]"\}}}�||rdn
�|��|��V��#dSrRrD)�.0rIrOrK�applyrbs    ��rF�	<genexpr>z&Segment.apply_style.<locals>.<genexpr>�s\�������)�D�&�'���D�'�<�$�$�u�u�V�}�}�g�F�F������rEc3�P�K�|] \}}}�||rdn|r|�zn�|��V��!dSrRrD)rsrIrOrKrbrps    ��rFruz&Segment.apply_style.<locals>.<genexpr>�sr�������*�D�&�'����#�M���5;�K�f�z�1�1����������rE)�__add__)rbrorJrp�result_segmentsrts`  ` @rF�apply_stylezSegment.apply_style�s������&#���	��M�E������-<����O��	������.=����O��rEFrYc�z�|rttd��|��Sttd��|��S)a2Filter segments by ``is_control`` attribute.

        Args:
            segments (Iterable[Segment]): An iterable of Segment instances.
            is_control (bool, optional): is_control flag to match in search.

        Returns:
            Iterable[Segment]: And iterable of Segment instances.

        rK)�filterrr)rbrorYs   rF�filter_controlzSegment.filter_control�s=���	@��*�Y�/�/��:�:�:��z�)�4�4�h�?�?�?rEc#�K�g}|j}|D]g}d|jvrQ|jsJ|\}}}|rA|�d��\}}	}|r||||����|	r
|V�g}|j}|�A�\||���h|r|V�dSdS)aSplit a sequence of segments in to a list of lines.

        Args:
            segments (Iterable[Segment]): Segments potentially containing line feeds.

        Yields:
            Iterable[List[Segment]]: Iterable of segment lists, one per line.
        rmN)�appendrIrK�	partition)
rbrornr~rZrIrJ�_�_text�new_lines
          rF�split_lineszSegment.split_lines�s�����!������	 �	 �G��w�|�#�#�G�O�#�!(���e�Q��-�,0�N�N�4�,@�,@�)�E�8�T��2���s�s�5�%�0�0�1�1�1��-�"�
�
�
�!��!%����-����w������	��J�J�J�J�J�	�	rET�length�pad�include_new_linesc#�K�g}|j}|j}|d��}	|D]�}
d|
jvr�|
js{|
\}}}
|rr|�d��\}}}|r||||����|r>|||||���}|r|�|	��|V�|���|�r��||
����|r|||||���V�dSdS)a�Split segments in to lines, and crop lines greater than a given length.

        Args:
            segments (Iterable[Segment]): An iterable of segments, probably
                generated from console.render.
            length (int): Desired line length.
            style (Style, optional): Style to use for any padding.
            pad (bool): Enable padding of lines that are less than `length`.

        Returns:
            Iterable[List[Segment]]: An iterable of lines of segments.
        rm)rJr�N)r~�adjust_line_lengthrIrKr�clear)rbror�rJr�r�rnr~r��new_line_segmentrZrI�
segment_styler�r�r��cropped_lines                 rF�split_and_crop_lineszSegment.split_and_crop_linessV����*!����� �3���3�t�9�9���	 �	 �G��w�|�#�#�G�O�#�)0�&��m�Q��%�,0�N�N�4�,@�,@�)�E�8�T��:���s�s�5�-�8�8�9�9�9��%�'9�'9� �&��3�(�(�(��-�B�(�/�/�0@�A�A�A�*�*�*�*��
�
�����%����w������	I�$�$�T�6��C�H�H�H�H�H�H�H�H�	I�	IrErnc�z�td�|D����}||kr$|r||d||z
z|��gz}n�|dd�}nw||krgg}|j}d}|D]X}|j}	||	z|ks|jr||��||	z
}�*|\}
}}t	|
||z
��}
|||
|����n
|dd�}|S)aAdjust a line to a given width (cropping or padding as required).

        Args:
            segments (Iterable[Segment]): A list of segments in a single line.
            length (int): The desired width of the line.
            style (Style, optional): The style of padding if used (space on the end). Defaults to None.
            pad (bool, optional): Pad lines with spaces if they are shorter than `length`. Defaults to True.

        Returns:
            List[Segment]: A line of segments with the desired length.
        c3�$K�|]}|jV��dSrR)rP)rsrZs  rFruz-Segment.adjust_line_length.<locals>.<genexpr>Js%����B�B�'�'�-�B�B�B�B�B�BrEr^Nr)�sumr~rPrKr)
rbrnr�rJr��line_lengthr�r~rZ�segment_lengthrIr�r�s
             rFr�zSegment.adjust_line_length7s��&�B�B�T�B�B�B�B�B�������
#��3�3�s�f�{�.B�'C�U�#K�#K�"L�L�������7���
�6�
!�
!��H��_�F��K��	
�	
��!(�!4����/�&�8�8�G�O�8��F�7�O�O�O��>�1�K�K�-4�*�D�-��(��v��/C�D�D�D��F�3�3�t�]�3�3�4�4�4����A�A�A�w�H��rEc�H��t�t�fd�|D����S)z�Get the length of list of segments.

        Args:
            line (List[Segment]): A line encoded as a list of Segments (assumes no '\\n' characters),

        Returns:
            int: The length of the line.
        c3�:�K�|]\}}}|��|��V��dSrRrD)rsrIrJrK�	_cell_lens    �rFruz*Segment.get_line_length.<locals>.<genexpr>os7�����S�S�';�t�U�G�7�S�9�9�T�?�?�S�S�S�S�S�SrE)rr�)rbrnr�s  @rF�get_line_lengthzSegment.get_line_lengthds-����	��S�S�S�S�t�S�S�S�S�S�SrE�linesc�r��|j�|rt�fd�|D����nd}|t|��fS)z�Get the shape (enclosing rectangle) of a list of lines.

        Args:
            lines (List[List[Segment]]): A list of lines (no '\\n' characters).

        Returns:
            Tuple[int, int]: Width and height in characters.
        c3�.�K�|]}�|��V��dSrRrD)rsrnr�s  �rFruz$Segment.get_shape.<locals>.<genexpr>|s-�����@�@�$����-�-�@�@�@�@�@�@rEr)r��maxr`)rbr��	max_widthr�s   @rF�	get_shapezSegment.get_shapeqsJ����-��DI�P�C�@�@�@�@�%�@�@�@�@�@�@�q�	��3�u�:�:�&�&rE�width�height�	new_linesc�<���	�|pt|��}|r|d�zdz���gn|d�z���g}|j�	|d|�}�	��fd�|D��|dd�<t|��|kr)|�|g|t|��z
z��|S)a�Set the shape of a list of lines (enclosing rectangle).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style, optional): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        r^rmNc�,��g|]}�|�������S))rJrD)rsrnr�rJr�s  ���rF�
<listcomp>z%Segment.set_shape.<locals>.<listcomp>�s9���
�
�
�=A���t�U�%�8�8�8�
�
�
rE)r`r��extend)
rbr�r�r�rJr��_height�blank�shaped_linesr�s
  ` `    @rF�	set_shapezSegment.set_shapes������*�&�C��J�J��1:�X�S�S��u��t�#�U�
+�
+�,�,���C�%�K�QV�@W�@W�?X�	�!�3���X�g�X���
�
�
�
�
�
�EJ�
�
�
��Q�Q�Q���|���w�&�&������7�S��5F�5F�+F� G�H�H�H��rErbc��|t|��z
}|s
|dd�S|d|�}|r|d|zdz|��n|d|z|��}||gg|zz}|S)a�Aligns lines to top (adds extra lines to bottom as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        Nr^rm�r`�rbr�r�r�rJr��extra_linesr�s        rF�	align_topzSegment.align_top�s���*�s�5�z�z�)���	�����8�O��g�v�g���2;�X���C�%�K�$�&��.�.�.���S�5�[�RW�AX�AX���%��	�K�/�/���rEc��|t|��z
}|s
|dd�S|d|�}|r|d|zdz|��n|d|z|��}|gg|z|z}|S)a�Aligns render to bottom (adds extra lines above as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added. Defaults to None.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        Nr^rmr�r�s        rF�align_bottomzSegment.align_bottom�s���*�s�5�z�z�)���	�����8�O��g�v�g���2;�X���C�%�K�$�&��.�.�.���S�5�[�RW�AX�AX����	�K�'�%�/���rEc���|t|��z
}|s
|dd�S|d|�}|r|d|zdz|��n|d|z|��}|dz}||z
}	|gg|z|z|gg|	zz}|S)a�Aligns lines to middle (adds extra lines to above and below as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        Nr^rmr!r�)
rbr�r�r�rJr�r�r��	top_lines�bottom_liness
          rF�align_middlezSegment.align_middle�s���*�s�5�z�z�)���	�����8�O��g�v�g���2;�X���C�%�K�$�&��.�.�.���S�5�[�RW�AX�AX���1�$�	�"�Y�.����	�I�%��-�%��	�L�0H�H���rEc#�K�t|��}	t|��}n#t$rYdSwxYwt}|D]>}|j|jkr&|js||j|jz|j��}�8|V�|}�?|V�dS)a)Simplify an iterable of segments by combining contiguous segments with the same style.

        Args:
            segments (Iterable[Segment]): An iterable of segments.

        Returns:
            Iterable[Segment]: A possibly smaller iterable of segments that will render the same way.
        N)�iter�next�
StopIterationrHrJrKrI)rbro�
iter_segments�last_segmentrcrZs      rF�simplifyzSegment.simplify�s������X���
�	��
�.�.�L�L���	�	�	��F�F�	������$�	'�	'�G��!�W�]�2�2�7�?�2�'�x� �%���4�l�6H� � ���#�"�"�"�&��������s�#�
1�1c#�K�|D]@}|js|j�|V��|\}}}|||r|�d��nd��V��AdS)z�Remove all links from an iterable of styles.

        Args:
            segments (Iterable[Segment]): An iterable segments.

        Yields:
            Segment: Segments with link removed.
        N)rKrJ�update_link)rbrorZrIrJ�_controls      rF�strip_linkszSegment.strip_linkss����� �	L�	L�G���
L�'�-�"7��
�
�
�
�(/�%��e�X��c�$�5� J�� 1� 1�$� 7� 7� 7�d�K�K�K�K�K�K�	L�	LrEc#�:K�|D]\}}}||d|��V��dS)z�Remove all styles from an iterable of segments.

        Args:
            segments (Iterable[Segment]): An iterable segments.

        Yields:
            Segment: Segments with styles replace with None
        NrD)rbrorIrOrKs     rF�strip_styleszSegment.strip_styles(sE����&.�	+�	+�!�D�&�'��#�d�D�'�*�*�*�*�*�*�	+�	+rEc#�K�i}|D]J\}}}|r3|�|��}|�|j}|||<||||��V��;||d|��V��KdS)z�Remove all color from an iterable of segments.

        Args:
            segments (Iterable[Segment]): An iterable segments.

        Yields:
            Segment: Segments with colorless style.
        N)�get�
without_color)rbro�cacherIrJrK�colorless_styles       rF�remove_colorzSegment.remove_color5s�����%'��$,�	/�	/� �D�%���
/�"'�)�)�E�"2�"2��"�*�&+�&9�O�#2�E�%�L��c�$���9�9�9�9�9�9��c�$��g�.�.�.�.�.�.�	/�	/rE�cutsc#�K�g}|j}t|��}	t|d��}|dkrgS|dkrngV��$d}|j}|j}	t
}
|D]�}|\}}
}|r�|r|n
||
|��z}||kr||��|}n�||krK||��|	��V�|��|}t|d��}|dkr|r|	��V�dSnm|�||z
��\}}|\}}
}||��|	��V�|��|}t|d��}|dkr|r|	��V�dS|���|	��V�dS)z�Divides an iterable of segments in to portions.

        Args:
            cuts (Iterable[int]): Cell positions where to divide.

        Yields:
            [Iterable[List[Segment]]]: An iterable of Segments in List.
        T���rN)r~r�r�r��copyrrk)rbror��split_segments�add_segment�	iter_cutsr[re�segments_clear�
segments_copyr�rZrIrOrK�end_posrfs                 rF�dividezSegment.divideKs����+-��$�+����J�J�	�	��y�"�%�%�C��b�y�y��	��a�x�x���H�H�H�
	���'�-��&�+�
�#�	��#	�#	�G�$+�!�D�&�'��!
�!(�C�#�#�c�I�I�d�O�O�.C���S�=�=��K��(�(�(�!�C���c�>�>��K��(�(�(�'�-�/�/�)�)�)�"�N�$�$�$�!�C��y�"�-�-�C��b�y�y�)�2�"/�-�/�/�1�1�1�����'.�&9�&9�#��)�&D�&D�O�F�G�,3�)�D�&�'��K��'�'�'�'�-�/�/�)�)�)�"�N�$�$�$��C��9�b�)�)���"�9�9�%�.�+�m�o�o�-�-�-��F�F�C�!
��F�m�o�o�����rE)rLrH)NN�F)NTT)NT)NNF)-r0r1r2r3�str�__annotations__rJr
rrKr�ControlCode�propertyr_rPrrTrVrWrY�classmethodrrrirkrnr
ryr|rr�r�r�r�r�r�rr�r�r�r�r�r�r�r�rDrErFrHrH?s�������
�
��I�I�I�!�E�8�E�?�!�!�!�/3�G�X�h�{�+�
,�3�3�3�
�0�S�0�0�0��X�0��v������$������(�D�(�(�(��X�(���Y�y���#6�9�#6�3�#6�5�AU�;V�#6�#6�#6����[�#6�J,�s�,�u�-A�'B�,�,�,�,�,�����[���"&�&*�	&�&��9�%�&����&��U�O�	&�

�)�	�&�&�&��[�&�P�?D�@�@��	�*�@�8<�@�	�)�	�@�@�@��[�@�$��8�I�#6��8�D��O�;T�����[��8�
"&��"&�
,I�,I��9�%�,I��,I����	,I�
�,I� �
,I�
�$�y�/�	"�,I�,I�,I��[�,I�\�
"&��*�*��9�o�*��*����	*�
�*�
�i��
*�*�*��[�*�X�
T�4�	�?�
T�s�
T�
T�
T��[�
T��'�d�4�	�?�3�'��c�3�h��'�'�'��[�'��
!%�!%��
!�!��D��O�$�!��!���
�	!�
���!��
!�
�d�9�o�	�!�!�!��[�!�F� �
��
�)�_���D��O�$�����	�
���
�
�d�9�o�	�����[��8� �
��
�)�_���D��O�$�����	�
���
�
�d�9�o�	�����[��8� �
��
�)�_���D��O�$�����	�
���
�
�d�9�o�	�����[��<���� 3����8K�����[��4�L�8�I�#6�L�8�I�;N�L�L�L��[�L� �
+�H�Y�$7�
+�H�Y�<O�
+�
+�
+��[�
+��/�H�Y�$7�/�H�Y�<O�/�/�/��[�/�*�B��	�*�B�2:�3�-�B�	�$�y�/�	"�B�B�B��[�B�B�BrErHc�H�eZdZdZddeededdfd�Z						dd
�ZdS)�Segmentsa=A simple renderable to render an iterable of segments. This class may be useful if
    you want to print segments outside of a __rich_console__ method.

    Args:
        segments (Iterable[Segment]): An iterable of segments.
        new_lines (bool, optional): Add new lines between segments. Defaults to False.
    Fror�rLNc�<�t|��|_||_dSrR)�listror�)rNror�s   rF�__init__zSegments.__init__�s���X����
�"����rE�consoler�optionsrrc#�K�|jr-t���}|jD]
}|V�|V��dS|jEd{V��dSrR)r�rHrnro)rNr�r�rnrZs     rF�__rich_console__zSegments.__rich_console__�sp�����>�	%��<�<�>�>�D��=�
�
���
�
�
��
�
�
�
�
�
��}�$�$�$�$�$�$�$�$�$rEr��r�rr�rrLr)	r0r1r2r3r
rHrVr�r�rDrErFr�r��s~��������#�#��'�!2�#�t�#�PT�#�#�#�#�	%� �	%�+;�	%�	�	%�	%�	%�	%�	%�	%rEr�c�P�eZdZd
deeededdfd�Z						dd�ZdS)�SegmentLinesFr�r�rLNc�<�t|��|_||_dS)a=A simple renderable containing a number of lines of segments. May be used as an intermediate
        in rendering process.

        Args:
            lines (Iterable[List[Segment]]): Lists of segments forming lines.
            new_lines (bool, optional): Insert new lines after each line. Defaults to False.
        N)r�r�r�)rNr�r�s   rFr�zSegmentLines.__init__�s���%�[�[��
�"����rEr�rr�rrc#�K�|jr1t���}|jD]}|Ed{V��|V��dS|jD]
}|Ed{V���dSrR)r�rHrnr�)rNr�r�r�rns     rFr�zSegmentLines.__rich_console__�s������>�	 ��|�|�~�~�H��
�
�
���������������
�
��
�
 �
 �����������
 �
 rEr�r�)	r0r1r2r
rrHrVr�r�rDrErFr�r��sx������	#�	#�h�t�G�}�5�	#�$�	#�SW�	#�	#�	#�	#�
 � �
 �+;�
 �	�
 �
 �
 �
 �
 �
 rEr��__main__)r)�Syntax)�Textz�from rich.console import Console
console = Console()
text = Text.from_markup("Hello, [bold magenta]World[/]!")
console.print(text)zHello, [bold magenta]World[/]!zrich.Segmentz]A Segment is the last step in the Rich render process before generating text with ANSI codes.z
Consider the following code:
�pythonT)�line_numberszRWhen you call [b]print()[/b], Rich [i]renders[/i] the object in to the following:
zAThe Segments are then processed to produce the following output:
zS
You will only need to know this if you are implementing your own Rich renderables.N):�enumr�	functoolsr�	itertoolsr�loggingr�operatorr�typingrr	r
rrr
rrrr�cellsrrrrr�reprrrrJrr�rrr�logr r_r�r�rHr�r�r0�rich.console�rich.syntaxr��	rich.textr��code�from_markuprI�rule�printr��render�	fragmentsrDrErF�<module>r�s���������������!�!�!�!�!�!���������������������������������������������������$�#�#�#�#�#�#�#��������?�>�>�>�>�>�>�>�>�>�>��i����������'����*�	�+��	�+�u�S�#�X��
&�'�	�+�s�C�
� �"�������N	�N	�N	�N	�N	�j�N	�N	�
��N	�b%�%�%�%�%�%�%�%�2 � � � � � � � �2�z���$�$�$�$�$�$�"�"�"�"�"�"��������D�
�4��<�=�=�D��g�i�i�G��L�L�� � � ��M�M�g�����M�M�4�5�5�5��M�M�&�&��x�d�;�;�;�<�<�<��M�M�O�O�O��M�M�]������W�^�^�D�)�)�*�*�I��M�M�)�����M�M�O�O�O��M�M�V�W�W�W��M�M�$�����M�M�^������;�rE

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 May 2024 6.33 PM
root / root
0755
__init__.cpython-311.pyc
7.275 KB
8 May 2024 6.33 PM
root / root
0644
__main__.cpython-311.pyc
11.141 KB
8 May 2024 6.33 PM
root / root
0644
_cell_widths.cpython-311.pyc
7.68 KB
8 May 2024 6.33 PM
root / root
0644
_emoji_codes.cpython-311.pyc
203.613 KB
8 May 2024 6.33 PM
root / root
0644
_emoji_replace.cpython-311.pyc
1.867 KB
8 May 2024 6.33 PM
root / root
0644
_export_format.cpython-311.pyc
2.276 KB
8 May 2024 6.33 PM
root / root
0644
_extension.cpython-311.pyc
0.575 KB
8 May 2024 6.33 PM
root / root
0644
_fileno.cpython-311.pyc
0.933 KB
8 May 2024 6.33 PM
root / root
0644
_inspect.cpython-311.pyc
13.833 KB
8 May 2024 6.33 PM
root / root
0644
_log_render.cpython-311.pyc
4.624 KB
8 May 2024 6.33 PM
root / root
0644
_loop.cpython-311.pyc
2.044 KB
8 May 2024 6.33 PM
root / root
0644
_null_file.cpython-311.pyc
4.055 KB
8 May 2024 6.33 PM
root / root
0644
_palettes.cpython-311.pyc
5.106 KB
8 May 2024 6.33 PM
root / root
0644
_pick.cpython-311.pyc
0.756 KB
8 May 2024 6.33 PM
root / root
0644
_ratio.cpython-311.pyc
7.713 KB
8 May 2024 6.33 PM
root / root
0644
_spinners.cpython-311.pyc
13.342 KB
8 May 2024 6.33 PM
root / root
0644
_stack.cpython-311.pyc
1.082 KB
8 May 2024 6.33 PM
root / root
0644
_timer.cpython-311.pyc
0.938 KB
8 May 2024 6.33 PM
root / root
0644
_win32_console.cpython-311.pyc
29.407 KB
8 May 2024 6.33 PM
root / root
0644
_windows.cpython-311.pyc
2.719 KB
8 May 2024 6.33 PM
root / root
0644
_windows_renderer.cpython-311.pyc
3.882 KB
8 May 2024 6.33 PM
root / root
0644
_wrap.cpython-311.pyc
3.745 KB
8 May 2024 6.33 PM
root / root
0644
abc.cpython-311.pyc
1.849 KB
8 May 2024 6.33 PM
root / root
0644
align.cpython-311.pyc
13.085 KB
8 May 2024 6.33 PM
root / root
0644
ansi.cpython-311.pyc
10.232 KB
8 May 2024 6.33 PM
root / root
0644
bar.cpython-311.pyc
4.421 KB
8 May 2024 6.33 PM
root / root
0644
box.cpython-311.pyc
12.618 KB
8 May 2024 6.33 PM
root / root
0644
cells.cpython-311.pyc
6.465 KB
8 May 2024 6.33 PM
root / root
0644
color.cpython-311.pyc
27.132 KB
8 May 2024 6.33 PM
root / root
0644
color_triplet.cpython-311.pyc
1.81 KB
8 May 2024 6.33 PM
root / root
0644
columns.cpython-311.pyc
10.375 KB
8 May 2024 6.33 PM
root / root
0644
console.cpython-311.pyc
120.66 KB
8 May 2024 6.33 PM
root / root
0644
constrain.cpython-311.pyc
2.388 KB
8 May 2024 6.33 PM
root / root
0644
containers.cpython-311.pyc
10.538 KB
8 May 2024 6.33 PM
root / root
0644
control.cpython-311.pyc
11.575 KB
8 May 2024 6.33 PM
root / root
0644
default_styles.cpython-311.pyc
12.25 KB
8 May 2024 6.33 PM
root / root
0644
diagnose.cpython-311.pyc
1.711 KB
8 May 2024 6.33 PM
root / root
0644
emoji.cpython-311.pyc
4.631 KB
8 May 2024 6.33 PM
root / root
0644
errors.cpython-311.pyc
2.255 KB
8 May 2024 6.33 PM
root / root
0644
file_proxy.cpython-311.pyc
3.919 KB
8 May 2024 6.33 PM
root / root
0644
filesize.cpython-311.pyc
3.204 KB
8 May 2024 6.33 PM
root / root
0644
highlighter.cpython-311.pyc
10.711 KB
8 May 2024 6.33 PM
root / root
0644
json.cpython-311.pyc
6.359 KB
8 May 2024 6.33 PM
root / root
0644
jupyter.cpython-311.pyc
6.223 KB
8 May 2024 6.33 PM
root / root
0644
layout.cpython-311.pyc
22.698 KB
8 May 2024 6.33 PM
root / root
0644
live.cpython-311.pyc
20.778 KB
8 May 2024 6.33 PM
root / root
0644
live_render.cpython-311.pyc
4.993 KB
8 May 2024 6.33 PM
root / root
0644
logging.cpython-311.pyc
14.145 KB
8 May 2024 6.33 PM
root / root
0644
markdown.cpython-311.pyc
39.483 KB
8 May 2024 6.33 PM
root / root
0644
markup.cpython-311.pyc
10.467 KB
8 May 2024 6.33 PM
root / root
0644
measure.cpython-311.pyc
7.081 KB
8 May 2024 6.33 PM
root / root
0644
padding.cpython-311.pyc
7.28 KB
8 May 2024 6.33 PM
root / root
0644
pager.cpython-311.pyc
2.173 KB
8 May 2024 6.33 PM
root / root
0644
palette.cpython-311.pyc
5.748 KB
8 May 2024 6.33 PM
root / root
0644
panel.cpython-311.pyc
12.511 KB
8 May 2024 6.33 PM
root / root
0644
pretty.cpython-311.pyc
43.406 KB
8 May 2024 6.33 PM
root / root
0644
progress.cpython-311.pyc
80.697 KB
8 May 2024 6.33 PM
root / root
0644
progress_bar.cpython-311.pyc
10.734 KB
8 May 2024 6.33 PM
root / root
0644
prompt.cpython-311.pyc
15.969 KB
8 May 2024 6.33 PM
root / root
0644
protocol.cpython-311.pyc
2.016 KB
8 May 2024 6.33 PM
root / root
0644
region.cpython-311.pyc
0.624 KB
8 May 2024 6.33 PM
root / root
0644
repr.cpython-311.pyc
7.412 KB
8 May 2024 6.33 PM
root / root
0644
rule.cpython-311.pyc
6.966 KB
8 May 2024 6.33 PM
root / root
0644
scope.cpython-311.pyc
4.218 KB
8 May 2024 6.33 PM
root / root
0644
screen.cpython-311.pyc
2.678 KB
8 May 2024 6.33 PM
root / root
0644
segment.cpython-311.pyc
30.809 KB
8 May 2024 6.33 PM
root / root
0644
spinner.cpython-311.pyc
6.699 KB
8 May 2024 6.33 PM
root / root
0644
status.cpython-311.pyc
6.58 KB
8 May 2024 6.33 PM
root / root
0644
style.cpython-311.pyc
34.354 KB
8 May 2024 6.33 PM
root / root
0644
styled.cpython-311.pyc
2.339 KB
8 May 2024 6.33 PM
root / root
0644
syntax.cpython-311.pyc
41.886 KB
8 May 2024 6.33 PM
root / root
0644
table.cpython-311.pyc
47.602 KB
8 May 2024 6.33 PM
root / root
0644
terminal_theme.cpython-311.pyc
3.599 KB
8 May 2024 6.33 PM
root / root
0644
text.cpython-311.pyc
65.528 KB
8 May 2024 6.33 PM
root / root
0644
theme.cpython-311.pyc
7.113 KB
8 May 2024 6.33 PM
root / root
0644
themes.cpython-311.pyc
0.327 KB
8 May 2024 6.33 PM
root / root
0644
traceback.cpython-311.pyc
33.689 KB
8 May 2024 6.33 PM
root / root
0644
tree.cpython-311.pyc
12.154 KB
8 May 2024 6.33 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF