
    tf	                     z    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y)   )BoxStyle)DictTraversal)KeyArgsConstructorc                   <    e Zd ZdZ e       Z	  e       Z	 d Zd Z	y)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                   j                  j	                   j                   j                  |                   t        |      D ]  \  }} j                  |      }|t        |      dz
  k(  rT|j                   j                  j                  |j                  d                   |j                   fd|D               ||j                   j                  j                  |j                  d                   |j                   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   T   K   | ]  }j                   j                  |       ! y wN)drawlast_child_tail.0lselfs     \/var/www/html/software/conda/envs/higlass/lib/python3.12/site-packages/asciitree/__init__.py	<genexpr>z%LeftAligned.render.<locals>.<genexpr>#   s(      2!" "YY66q9 2   %(c              3   T   K   | ]  }j                   j                  |       ! y wr   )r   
child_tailr   s     r   r   z%LeftAligned.render.<locals>.<genexpr>'   s(      2!" "YY11!4 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   s    ==--d3TYY))$--*@*@*FGH!(+ 	2HAuU+JCMA%%TYY66z~~a7HIJ 2&02 2 TYY11*..2CDE 2&02 2	2     c                 t    dj                  | j                  | j                  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__,   s+     yyT]]%;%;D%ABCCr)   N)
__name__
__module____qualname____doc__r   r   r   r   r   r/    r)   r   r   r   	   s(    
 :DAHD0Dr)   r   )Style)	Traversalc                   *    e Zd Zd Zd Zd Zd Zd Zy)LegacyStylec                     |S r   r4   )r   texts     r   r   zLegacyStyle.node_label:   s    r)   c                     d|z   S Nz  +--r4   r   labels     r   r"   zLegacyStyle.child_head=       r)   c                     d|z   S )Nz  |r4   r   lines     r   r   zLegacyStyle.child_tail@       t|r)   c                     d|z   S r<   r4   r=   s     r   r   zLegacyStyle.last_child_headC   r?   r)   c                     d|z   S )Nz   r4   rA   s     r   r   zLegacyStyle.last_child_tailF   rC   r)   N)r0   r1   r2   r   r"   r   r   r   r4   r)   r   r8   r8   9   s    r)   r8   c                     | j                   S r   )r%   )r&   s    r   <lambda>rG   K   s
    1:: r)   c                 N     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   r6   r8   )r#   
child_itertext_strs      r   	draw_treerK   J   s-    +;	87A!C'M++/1 1r)   N)drawingr   	traversalr   utilr   r   r5   r6   r8   strrK   r4   r)   r   <module>rP      sA     $ $'D$ 'DX   % $ .	1r)   