
    DUf	                         d dl mZ d dlmZ d dlmZ  G d de          Zd dl mZ d dlmZ  G d d	e          Z	d
 e
fdZdS )   )BoxStyle)DictTraversal)KeyArgsConstructorc                   J    e Zd ZdZ e            Z	  e            Z	 d Zd Z	dS )LeftAlignedzCreates a renderer for a left-aligned tree.

    Any attributes of the resulting class instances can be set using
    constructor arguments.c                     g } j                             |          }|                     j                             j                             |                               t          |          D ]\  }}                     |          }|t          |          dz
  k    rb|                     j        	                    |
                    d                               |                     fd|D                        |                     j                            |
                    d                               |                     fd|D                        |S )zRenders a node. This function is used internally, as it returns
        a list of lines. Use :func:`~asciitree.LeftAligned.__call__` instead.
        r       c              3   L   K   | ]}j                             |          V  d S N)drawlast_child_tail.0lselfs     O/var/www/html/software/conda/lib/python3.11/site-packages/asciitree/__init__.py	<genexpr>z%LeftAligned.render.<locals>.<genexpr>#   sG       2 2!" "Y66q99 2 2 2 2 2 2    c              3   L   K   | ]}j                             |          V  d S r   )r   
child_tailr   s     r   r   z%LeftAligned.render.<locals>.<genexpr>'   sG       2 2!" "Y11!44 2 2 2 2 2 2r   )traverseget_childrenappendr   
node_labelget_text	enumeraterenderlenlast_child_headpopextend
child_head)r   nodelineschildrennchild
child_trees   `      r   r   zLeftAligned.render   sz    =--d33TY))$-*@*@*F*FGGHHH!(++ 	2 	2HAuU++JCMMA%%%TY66z~~a7H7HIIJJJ 2 2 2 2&02 2 2 2 2 2 2 TY11*..2C2CDDEEE 2 2 2 2&02 2 2 2 2 2 2 r   c                     d                     |                     | j                            |                              S )zVRender the tree into string suitable for console output.

        :param tree: A tree.
)joinr   r   get_root)r   trees     r   __call__zLeftAligned.__call__,   s2     yyT]%;%;D%A%ABBCCCr   N)
__name__
__module____qualname____doc__r   r   r   r   r   r.    r   r   r   r   	   s_         
 8::DA}HD  0D D D D Dr   r   )Style)	Traversalc                   ,    e Zd Zd Zd Zd Zd Zd ZdS )LegacyStylec                     |S r   r3   )r   texts     r   r   zLegacyStyle.node_label:   s    r   c                     d|z   S Nz  +--r3   r   labels     r   r"   zLegacyStyle.child_head=       r   c                     d|z   S )Nz  |r3   r   lines     r   r   zLegacyStyle.child_tail@       t|r   c                     d|z   S r;   r3   r<   s     r   r   zLegacyStyle.last_child_headC   r>   r   c                     d|z   S )Nz   r3   r@   s     r   r   zLegacyStyle.last_child_tailF   rB   r   N)r/   r0   r1   r   r"   r   r   r   r3   r   r   r7   r7   9   s_                    r   r7   c                     | j         S r   )r%   )r&   s    r   <lambda>rF   K   s    1: r   c                 l     t          t          ||          t                                |           S )zSupport asciitree 0.2 API.

    This function solely exist to not break old code (using asciitree 0.2).
    Its use is deprecated.)r   r   )r   r   )r   r5   r7   )r#   
child_itertext_strs      r   	draw_treerJ   J   sJ    +;	87A!C !C !C'MM+ + ++/1 1 1r   N)drawingr   	traversalr   utilr   r   r4   r5   r7   strrJ   r3   r   r   <module>rO      s          $ $ $ $ $ $ $ $ $ $ $ $'D 'D 'D 'D 'D$ 'D 'D 'DX                      %   $ .-	1 	1 	1 	1 	1 	1r   