§
    ÷yIfp  ã                  ó€   — d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	m
Z
 e	rddlmZmZmZmZmZ  G d„ d	¦  «        ZdS )
z¡Universal report objects and some formatting drivers.

A way to create simple reports using python objects, primarily designed to be
formatted as text and html.
é    )ÚannotationsN)ÚIterator)ÚStringIO)ÚTYPE_CHECKINGÚTextIO)Ú
BaseLayoutÚEvaluationSectionÚ	ParagraphÚSectionÚTablec                  ód   — e Zd ZdZej        dfdd„Zdd„Zddd„Zdd„Z	dd„Z
dd„Zd d„Zd!d„ZdS )"Ú
BaseWriterzBase class for ureport writers.NÚlayoutr   Ústreamr   Úencodingú
str | NoneÚreturnÚNonec                óÆ   — |st          |dd¦  «        }|pd| _        || _        |                      ¦   «          |                     | ¦  «         |                      ¦   «          dS )zùFormat and write the given layout into the stream object.

        unicode policy: unicode strings may be found in the layout;
        try to call 'stream.write' with it, but give it back encoded using
        the given encoding if it fails
        r   zUTF-8N)Úgetattrr   ÚoutÚbegin_formatÚacceptÚ
end_format)Úselfr   r   r   s       úY/var/www/piapp/venv/lib/python3.11/site-packages/pylint/reporters/ureports/base_writer.pyÚformatzBaseWriter.format   sj   € ð ð 	<Ý˜v z°7Ñ;Ô;ˆHØ Ð+ GˆŒØˆŒØ×ÒÑÔÐØ�Š�dÑÔÐØ�ŠÑÔÐÐÐó    ú'EvaluationSection | Paragraph | Sectionc                óX   — t          |dd¦  «        D ]}|                     | ¦  «         ŒdS )zgRecurse on the layout children and call their accept method
        (see the Visitor pattern).
        Úchildren© N)r   r   )r   r   Úchilds      r   Úformat_childrenzBaseWriter.format_children3   s>   € õ ˜V Z°Ñ4Ô4ð 	ð 	ˆEØ�LŠL˜ÑÔÐÐð	ð 	r   Ú ÚstringÚstrc                ó6   — |                       |dz   ¦  «         dS )z"Write a line in the output buffer.ú
N)Úwrite©r   r&   s     r   ÚwritelnzBaseWriter.writeln:   s   € à�
Š
�6˜D‘=Ñ!Ô!Ð!Ð!Ð!r   c                ó:   — | j                              |¦  «         dS )z$Write a string in the output buffer.N)r   r*   r+   s     r   r*   zBaseWriter.write>   s   € àŒ�Š�vÑÔÐÐÐr   c                ó   — d| _         dS )zBegin to format a layout.r   N)Úsection©r   s    r   r   zBaseWriter.begin_formatB   s   € àˆŒˆˆr   c                ó   — dS )zFinished formatting a layout.Nr"   r0   s    r   r   zBaseWriter.end_formatF   s   € € € r   Útabler   úlist[list[str]]c           	     ó"  — g g}|j         }|                      |¦  «        D ]D}|dk    r|                     g ¦  «         |j         }|dz  }|d                              |¦  «         ŒE|dxx         dg|t          |d         ¦  «        z
  z  z  cc<   |S )z‘Trick to get table content without actually writing it.

        return an aligned list of lists containing table cells values as string
        r   é   éÿÿÿÿr%   )ÚcolsÚcompute_contentÚappendÚlen)r   r2   Úresultr7   Úcells        r   Úget_table_contentzBaseWriter.get_table_contentI   s¦   € ð
 $& $ˆØŒzˆØ×(Ò(¨Ñ/Ô/ð 	$ð 	$ˆDØ�qŠyˆyØ—’˜bÑ!Ô!Ð!Ø”z�Ø�A‰IˆDØ�2ŒJ×Ò˜dÑ#Ô#Ð#Ð#àˆrˆ
ˆ
Œ
�r�d˜d¥S¨°¬¡_¤_Ñ4Ñ5Ñ5ˆ
ˆ
‰
Øˆr   úIterator[str]c              #  óÖ   K  — | j         }	 |j        D ]B}t          ¦   «         }|| _         |                     | ¦  «         |                     ¦   «         V — ŒC	 || _         dS # || _         w xY w)z£Trick to compute the formatting of children layout before actually
        writing it.

        return an iterator on strings (one for each child element)
        N)r   r!   r   r   Úgetvalue)r   r   r   r#   r   s        r   r8   zBaseWriter.compute_contentZ   s�   è è € ð Œhˆð	Øœð (ð (�Ý!™œ�Ø!�”Ø—’˜TÑ"Ô"Ð"Ø—o’oÑ'Ô'Ð'Ð'Ð'Ð'ð	(ð ˆDŒHˆHˆHø�sˆDŒHˆNˆNˆNˆNs   ‹A
A Á	A()r   r   r   r   r   r   r   r   )r   r   r   r   )r%   )r&   r'   r   r   )r   r   )r2   r   r   r3   )r   r   r   r>   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚsysÚstdoutr   r$   r,   r*   r   r   r=   r8   r"   r   r   r   r      sÎ   € € € € € Ø)Ð)ð
 œØ#ð	ð ð ð ð ð(ð ð ð ð"ð "ð "ð "ð "ðð ð ð ðð ð ð ð,ð ,ð ,ð ,ðð ð ð ð"ð ð ð ð ð r   r   )rD   Ú
__future__r   rE   Úcollections.abcr   Úior   Útypingr   r   Úpylint.reporters.ureports.nodesr   r	   r
   r   r   r   r"   r   r   ú<module>rL      sò   ðð
ð ð #Ð "Ð "Ð "Ð "Ð "à 
€
€
€
Ø $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (àð ðð ð ð ð ð ð ð ð ð ð ð ð ð ðOð Oð Oð Oð Oñ Oô Oð Oð Oð Or   