
    }f                     8    d dl Z d dlmZ ddlmZ  G d d      Zy)    N)contextmanager   )trimc                       e Zd ZddefdZd Zd Zd Zd Ze	ddedz  fd	       Z
ed
        Zed        Zddee   dz  fdZd Zy)IndentPrintMixindefault_indentc                 T    || _         dg| _        t        j                         | _        y )Nr   )r   indent_stackioStringIOoutput_stream)selfr   s     R/var/www/feuerwehr-webapp/venv/lib/python3.12/site-packages/tatsu/mixins/indent.py__init__zIndentPrintMixin.__init__   s"    ,()s[[]    c                 6    | j                   j                         S N)r   getvaluer   s    r   printed_textzIndentPrintMixin.printed_text   s    !!**,,r   c                     |D cg c]  }|t        t        |             }} | j                  |i |} | j                  |fi | y c c}w r   )r   stras_printed_lines_do_print_lines)r   argskwargsargliness        r   printzIndentPrintMixin.print   sS    *.B3#/SXBB%%%t6v6U-f- Cs
   AAc                 H     | j                   |i |}dj                  |      S )N
)r   join)r   r   r   r   s       r   
as_printedzIndentPrintMixin.as_printed   s(    %%%t6v6yyr   c                 H     | j                   |i |}| j                  |      S r   )io_printindented_lines)r   r   r   texts       r   r   z!IndentPrintMixin.as_printed_lines   s(    t}}d-f-""4((r   Namountc              #     K   ||dk\  sJ || j                   }| j                  j                  || j                  d   z          	 d  | j                  j                          y # | j                  j                          w xY ww)Nr   )r   r
   appendpop)r   r(   s     r   indentzIndentPrintMixin.indent   sw     ~1,,>((F  $*;*;B*?!?@	$!!#D!!#s   ABA% 
B%BBc                 &    d| j                   d   z  S )N r*   )r
   r   s    r   current_indentationz$IndentPrintMixin.current_indentation)   s    T&&r***r   c                      |j                  dd        t        j                         5 }t        | d|i| |j	                         cd d d        S # 1 sw Y   y xY w)Nfile)r,   r   r   r   r   )r   r   outputs      r   r%   zIndentPrintMixin.io_print-   sL    

64 [[] 	%f4/f//??$	% 	% 	%s   AAr   c                 v    |st        dd| j                  i| y |D ]  }t        |fd| j                  i|  y )Nr2    )r   r   )r   r   r   lines       r   r   z IndentPrintMixin._do_print_lines4   sE    4t))4V4 	;D$:T//:6:	;r   c                     t        |      }|j                  d      D cg c]  }| j                  |z   j                         ! c}S c c}w )NF)keepends)r   
splitlinesr0   rstrip)r   r'   r6   s      r   r&   zIndentPrintMixin.indented_lines<   sL    Dz 7
 %%,446
 	
 
s   $A)   r   )__name__
__module____qualname__intr   r   r   r#   r   r   r-   propertyr0   staticmethodr%   listr   r   r&   r5   r   r   r   r      s    +s +
-.
 ) 	$S4Z 	$ 	$ + + % %;T#Y%5 ;
r   r   )r   
contextlibr   utilr   r   r5   r   r   <module>rE      s    	 % :
 :
r   