HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/__pycache__/tree.cpython-310.pyc
o

��h�$�@s&ddlmZmZmZmZddlmZmZddlm	Z	m
Z
mZmZddl
mZddlmZddlmZddlmZmZmZdd	lmZeeeeefZGd
d�de�Zedk�rdd
lmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&e&ddgd�Z'e'j(dddd�e'j(ddd�e'j(dddd�e'�)d d!d"�e'�)d#d$d%�e'�)d&d'd(�e'�)d)d*d+�d,Z*e$e*d-d.dd/�Z+e d0�Z,ed1ddd2�Z-e-j.d3d4d5�Z/e/j.d6d7d5�Z0e0�.ed8e+��e0�.ed9e"e,dd:���e/j.d;d<d5�Z1de1_2e"j3d=d4d:�Z4e1�.ed>e4��e1�.ed?e'��e	�Ze�5e-�d@Sd@S)A�)�Iterator�List�Optional�Tuple�)�
loop_first�	loop_last)�Console�ConsoleOptions�RenderableType�RenderResult)�JupyterMixin)�Measurement)�Segment)�Style�
StyleStack�	StyleType)�Styledc@s�eZdZdZdZgd�Zdddddd�d	ed
ededed
ededdfdd�Z	ddddd�d	ed
e
ede
eded
e
eddfdd�Z						d dd�Z						d!dd�Z
dS)"�Treea�A renderable for a tree structure.

    Attributes:
        ASCII_GUIDES (GuideType): Guide lines used when Console.ascii_only is True.
        TREE_GUIDES (List[GuideType, GuideType, GuideType]): Default guide lines.

    Args:
        label (RenderableType): The renderable or str for the tree label.
        style (StyleType, optional): Style of this tree. Defaults to "tree".
        guide_style (StyleType, optional): Style of the guide lines. Defaults to "tree.line".
        expanded (bool, optional): Also display children. Defaults to True.
        highlight (bool, optional): Highlight renderable (if str). Defaults to False.
        hide_root (bool, optional): Hide the root node. Defaults to False.
    )�    z|   z+-- z`-- ))ru│   u
├── u
└── )ru┃   u
┣━━ u
┗━━ )ru║   u
╠══ u
╚══ �treez	tree.lineTF)�style�guide_style�expanded�	highlight�	hide_root�labelrrrrr�returnNcCs.||_||_||_g|_||_||_||_dS�N)rrr�childrenrrr)�selfrrrrrr�r!�@/usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/tree.py�__init__%s

z
Tree.__init__�rrrrcCsLt||dur	|jn||dur|jn|||dur|jn|d�}|j�|�|S)a3Add a child tree.

        Args:
            label (RenderableType): The renderable or str for the tree label.
            style (StyleType, optional): Style of this tree. Defaults to "tree".
            guide_style (StyleType, optional): Style of the guide lines. Defaults to "tree.line".
            expanded (bool, optional): Also display children. Defaults to True.
            highlight (Optional[bool], optional): Highlight renderable (if str). Defaults to False.

        Returns:
            Tree: A new child Tree, which may be further modified.
        Nr$)rrrrr�append)r rrrrr�noder!r!r"�add7s�zTree.add�consoler	�optionsr
rc#s��g}|j}|j}t��}|j}t��}|�jdd�p|}	td�\}
}}}
t�dt	dtdtf���fdd�}|||	�g}|t
t�g���t|�j��}t|�j
��}td	d	d
�}d}|�rh|�}zt|�\}}Wn%ty�|��|r�|dj
p||}	|||	�|d<|��|��Yq[w||�|r�||
|dj
p�|�|d<|j||j�}	|j||j
�}|�jr�d
ndd�}|jt|j|��j�jtdd�|D���jdd��jdud�}|dkr�j�st|�D]2\}}|r��j||j|d�EdH|EdH|V|�r|�r||�r|
n||dj
�p|�|d<q�|j�rd|j�rd||�r)|
n||dj
�p1|�|d<|�|t|j�dk�rB|
n||	��|� ||j
��|� ||j��|t
t|j���|d7}|s^dSdS)N�)�default��indexrrcsL�jr	�j|}n|jrdn|jrdnd}�j�jrdn||}�||�S)z.Make a Segment for a level of the guide lines.r�r)�
ascii_only�ASCII_GUIDES�bold�
underline2�TREE_GUIDES�legacy_windows)r-r�line�guide��_Segmentr)r r!r"�
make_guidees

z)Tree.__rich_console__.<locals>.make_guideF)r1r2r���r.rcss�|]}|jVqdSr)�cell_length)�.0�levelr!r!r"�	<genexpr>�s�z(Tree.__rich_console__.<locals>.<genexpr>)�widthr�height)�pad)�
post_style)!�popr%rr5�	get_styler�nullr�range�int�iterrrr�next�
StopIteration�currentr�render_linesrr�update�	max_width�sumr�justifyr�apply_style�background_stylerr�len�push)r r(r)�stackrCrT�new_linerD�
null_styler�SPACE�CONTINUE�FORK�ENDr9�levels�guide_style_stack�style_stack�remove_guide_styles�depth�
stack_node�lastr&r�prefix�renderable_lines�firstr5r!r7r"�__rich_console__Vs��	�
����
�����zTree.__rich_console__rcCs�t|g�g}|j}|j}d}d}tj}d}	|r`|�}
zt|
�}Wn
ty-|	d8}	Yqw||
�||||j�\}}
|	d}t|||�}t|
||�}|j	r^|j
r^|t|j
��|	d7}	|st||�S)Nrrr,)rHrCr%r�getrIrJr�maxrr)r r(r)rUrCrT�minimum�maximum�measurer=�	iter_treer�min_measure�max_measure�indentr!r!r"�__rich_measure__�s2��
zTree.__rich_measure__)r(r	r)r
rr)r(r	r)r
rr)�__name__�
__module__�__qualname__�__doc__r0r3rr�boolr#rr'rfrpr!r!r!r"rsn
�������	
�������
���
�Z���r�__main__)�Group)�Markdown)�Panel)�Syntax)�Tabler*�dim)�
row_styles�Released�cyanT)r�no_wrap�Title�magenta)rz
Box Office�right�green)rPrzDec 20, 2019z Star Wars: The Rise of Skywalkerz$952,110,690zMay 25, 2018zSolo: A Star Wars Storyz$393,151,347zDec 15, 2017z!Star Wars Ep. V111: The Last Jediz$1,332,539,889zDec 16, 2016zRogue One: A Star Wars Storyz$1,332,439,889zmclass Segment(NamedTuple):
    text: str = ""
    style: Optional[Style] = None
    is_control: bool = False
�python�monokai)�theme�line_numbersz=### example.md
> Hello, World!
>
> Markdown _all_ the things
u🌲 [b green]Rich Tree)rrz:file_folder: Renderables�red)rz!:file_folder: [bold yellow]Atomiczuu greenu📄 Syntaxu
📄 Markdown)�border_stylez&:file_folder: [bold magenta]Containerszbold magentazJust a panelu📄 Panelsu📄 [b magenta]TableN)6�typingrrrr�_looprrr(r	r
rr�jupyterr
rkr�segmentrrrrr�styledr�str�	GuideTyperrq�pip._vendor.rich.consolerw�pip._vendor.rich.markdownrx�pip._vendor.rich.panelry�pip._vendor.rich.syntaxrz�pip._vendor.rich.tabler{�table�
add_column�add_row�code�syntax�markdown�rootr'r&�simple_node�containers_noder�fit�panel�printr!r!r!r"�<module>sZ
?�	��