§
    XøÁi°(  ã                   ó>   — d Z ddlZddlmZ  G d„ d¦  «        Zd„ ZdS )z<utilities for generating and formatting literal Python code.é    N)Ú
exceptionsc                   ó`   — e Zd Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Z	d	„ Z
d
„ Zdd„Zd„ Zd„ Zd„ ZdS )ÚPythonPrinterc                 óÊ  — d| _         g | _        d| _        || _        d| _        g | _        d| _        |                      ¦   «          i | _        t          j
        d¦  «        | _        t          j
        d¦  «        | _        t          j
        d¦  «        | _        t          j
        d¦  «        | _        t          j
        d	¦  «        | _        t          j
        d
¦  «        | _        d S )Nr   z    é   Fz^\s*#z^\s*$z:[ \t]*(?:#.*)?$z ^\s*(if|try|elif|while|for|with)z(^\s*(def|class|else|elif|except|finally)z"^\s*(else|elif|except|finally).*\:)ÚindentÚindent_detailÚindentstringÚstreamÚlinenoÚline_bufferÚin_indent_linesÚ_reset_multi_line_flagsÚ
source_mapÚreÚcompileÚ_re_space_commentÚ	_re_spaceÚ
_re_indentÚ_re_compoundÚ_re_indent_keywordÚ_re_unindentor)Úselfr   s     úT/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/mako/pygen.pyÚ__init__zPythonPrinter.__init__   sÖ   € àˆŒð
  ˆÔð #ˆÔð ˆŒð ˆŒð ˆÔà$ˆÔà×$Ò$Ñ&Ô&Ð&ð ˆŒå!#¤¨HÑ!5Ô!5ˆÔÝœ HÑ-Ô-ˆŒÝœ*Ð%8Ñ9Ô9ˆŒÝœJÐ'JÑKÔKˆÔÝ"$¤*Ø7ñ#
ô #
ˆÔõ !œjÐ)NÑOÔOˆÔÐÐó    c                 ó&   — | xj         |z  c_         d S ©N)r   ©r   Únums     r   Ú_update_linenozPythonPrinter._update_lineno7   s   € ØˆŒ�sÑˆŒˆˆr   c                 óD   — | j         | j        vr|| j        | j         <   d S d S r   )r   r   )r   r   s     r   Ústart_sourcezPythonPrinter.start_source:   s-   € ØŒ;˜dœoÐ-Ð-Ø+1ˆDŒO˜DœKÑ(Ð(Ð(ð .Ð-r   c                 ój   — | j                              d|z  ¦  «         |                      |¦  «         d S )Nú
)r   Úwriter!   r   s     r   Úwrite_blankszPythonPrinter.write_blanks>   s6   € ØŒ×Ò˜$ ™*Ñ%Ô%Ð%Ø×Ò˜CÑ Ô Ð Ð Ð r   Nc                 óö   — d| _         t          t          j        d|¦  «        ¦  «        D ]N\  }}| j                             |¦  «         |�|                      ||z   ¦  «         |                      d¦  «         ŒOdS )zµprint a line or lines of python which already contain indentation.

        The indentation of the total block of lines will be adjusted to that of
        the current indent level.Fú\r?\nNr   )r   Ú	enumerater   Úsplitr   Úappendr#   r!   )r   ÚblockÚstarting_linenoÚiÚls        r   Úwrite_indented_blockz"PythonPrinter.write_indented_blockB   sŠ   € ð
  %ˆÔÝ�bœh x°Ñ7Ô7Ñ8Ô8ð 	#ð 	#‰DˆAˆqØÔ×#Ò# AÑ&Ô&Ð&ØÐ*Ø×!Ò! /°AÑ"5Ñ6Ô6Ð6Ø×Ò Ñ"Ô"Ð"Ð"ð		#ð 	#r   c                 ó:   — |D ]}|                       |¦  «         ŒdS )z"print a series of lines of python.N)Ú	writeline)r   ÚlinesÚlines      r   Ú
writelineszPythonPrinter.writelinesN   s0   € àð 	!ð 	!ˆDØ�NŠN˜4Ñ Ô Ð Ð ð	!ð 	!r   c                 óD  — | j         s|                      ¦   «          d| _         |�4| j                             |¦  «        s| j                             |¦  «        rd}nd}|ot          |¦  «        o|d         dk    }|sw|r|                      |¦  «        r`| j        dk    rU| xj        dz  c_        t          | j        ¦  «        dk    rt          j
        d¦  «        ‚| j                             ¦   «          |€dS | j                             |                      |¦  «        dz   ¦  «         |                      t          |                     d¦  «        ¦  «        ¦  «         | j                             |¦  «        r§| j                             |¦  «        }|rA|                     d¦  «        }| xj        dz  c_        | j                             |¦  «         dS d}| j                             |¦  «        }|r.| xj        dz  c_        | j                             |¦  «         dS dS dS )	z¾print a line of python, indenting it according to the current
        indent level.

        this also adjusts the indentation counter according to the
        content of the line.

        TNFr   ú#r   zToo many whitespace closuresr%   )r   Ú_flush_adjusted_linesr   Úmatchr   ÚlenÚ_is_unindentorr   r	   r   ÚMakoExceptionÚpopr   r&   Ú_indent_liner!   r+   r   Úsearchr   Úgroupr,   r   )r   r5   ÚhastextÚ
is_commentr:   ÚindentorÚm2s          r   r3   zPythonPrinter.writelineS   sI  € ð Ô#ð 	(Ø×&Ò&Ñ(Ô(Ð(Ø#'ˆDÔ ð ˆLØÔ%×+Ò+¨DÑ1Ô1ð àŒ~×#Ò# DÑ)Ô)ð ð ˆGˆGàˆGàÐ:�c $™iœiÐ:¨D°¬G°sªNˆ
ð ð	%àð	%à $× 3Ò 3°DÑ 9Ô 9ð	%ð ”˜a’�àˆKŒK˜1ÑˆKŒKõ �4Ô%Ñ&Ô&¨!Ò+Ð+å Ô.Ð/MÑNÔNÐNØÔ×"Ò"Ñ$Ô$Ð$àˆ<ØˆFð 	Œ×Ò˜$×+Ò+¨DÑ1Ô1°DÑ8Ñ9Ô9Ð9Ø×Ò�C §
¢
¨4Ñ 0Ô 0Ñ1Ô1Ñ2Ô2Ð2ð Œ?×!Ò! $Ñ'Ô'ð 	8ð
 Ô%×+Ò+¨DÑ1Ô1ˆEØð 8à Ÿ;š; q™>œ>�Ø�”˜qÑ �”ØÔ"×)Ò)¨(Ñ3Ô3Ð3Ð3Ð3à�ð Ô,×2Ò2°4Ñ8Ô8�Øð 8Ø�K”K 1Ñ$�K”KØÔ&×-Ò-¨hÑ7Ô7Ð7Ð7Ð7ð'	8ð 	8ð"8ð 8r   c                 ó.   — |                       ¦   «          dS )z1close this printer, flushing any remaining lines.N)r9   ©r   s    r   ÚclosezPythonPrinter.closeš   s   € à×"Ò"Ñ$Ô$Ð$Ð$Ð$r   c                 óª   — t          | j        ¦  «        dk    rdS | j        d         }|€dS | j                             |¦  «        }t	          |¦  «        S )zqreturn true if the given line is an 'unindentor',
        relative to the last 'indent' event received.

        r   Féÿÿÿÿ)r;   r	   r   r:   Úbool)r   r5   rD   r:   s       r   r<   zPythonPrinter._is_unindentorž   s_   € õ ˆtÔ!Ñ"Ô" aÒ'Ð'Ø�5àÔ% bÔ)ˆð ÐØ�5ð Ô#×)Ò)¨$Ñ/Ô/ˆõ �E‰{Œ{Ðr   Ú c                 ó~   — |dk    r| j         | j        z  |z   S t          j        d|z  | j         | j        z  |¦  «        S )z±indent the given line according to the current indent level.

        stripspace is a string of space that will be truncated from the
        start of the line before indenting.rL   ú^%s)r
   r   r   Úsub)r   r5   Ú
stripspaces      r   r?   zPythonPrinter._indent_lineÆ   sN   € ð
 ˜ÒÐàÔ$ t¤{Ñ2°TÑ9Ð9åŒvØ�ZÑ Ô!2°T´[Ñ!@À$ñ
ô 
ð 	
r   c                 ó$   — d\  | _         | _        dS )z^reset the flags which would indicate we are in a backslashed
        or triple-quoted section.)FFN)ÚbackslashedÚtriplequotedrG   s    r   r   z%PythonPrinter._reset_multi_line_flagsÓ   s   € ð /;Ñ+ˆÔ˜$Ô+Ð+Ð+r   c                 óì   — | j         p| j        }t          t          j        d|¦  «        ¦  «        | _         t          t          j        d|¦  «        ¦  «        }|dk    s	|dz  dk    r| j         | _        |S )zcreturn true if the given line is part of a multi-line block,
        via backslash or triple-quote.ú\\$ú\"\"\"|\'\'\'r   é   r   )rR   rS   rK   r   r@   r;   Úfindall)r   r5   Úcurrent_stateÚtripless       r   Ú_in_multi_linezPythonPrinter._in_multi_lineÙ   su   € ð Ô(Ð=¨DÔ,=ˆå¥¤	¨&°$Ñ 7Ô 7Ñ8Ô8ˆÔÝ•b”jÐ!1°4Ñ8Ô8Ñ9Ô9ˆØ�aŠ<ˆ<˜7 Q™;¨!Ò+Ð+Ø$(Ô$5Ð 5ˆDÔàÐr   c                 óê  — d }|                       ¦   «          | j        D ]¹}|                      |¦  «        r| j                             |dz   ¦  «         Œ5|                     ¦   «         }|€=t          j        d|¦  «        r(t          j        d|¦  «         	                    d¦  «        }| j                             |  
                    ||¦  «        dz   ¦  «         Œºg | _        |                       ¦   «          d S )Nr%   ú^[ \t]*[^# \t]ú	^([ \t]*)r   )r   r   r[   r   r&   Ú
expandtabsr   r@   r:   rA   r?   )r   rP   Úentrys      r   r9   z#PythonPrinter._flush_adjusted_linesì   s÷   € Øˆ
Ø×$Ò$Ñ&Ô&Ð&àÔ%ð 	Oð 	OˆEØ×"Ò" 5Ñ)Ô)ð OØ”×!Ò! %¨$¡,Ñ/Ô/Ð/Ð/à×(Ò(Ñ*Ô*�ØÐ%­"¬)Ð4EÀuÑ*MÔ*MÐ%Ý!#¤¨,¸Ñ!>Ô!>×!DÒ!DÀQÑ!GÔ!G�JØ”×!Ò! $×"3Ò"3°E¸:Ñ"FÔ"FÈÑ"MÑNÔNÐNÐNàˆÔØ×$Ò$Ñ&Ô&Ð&Ð&Ð&r   r   ©rL   )Ú__name__Ú
__module__Ú__qualname__r   r!   r#   r'   r1   r6   r3   rH   r<   r?   r   r[   r9   © r   r   r   r      sê   € € € € € ð&Pð &Pð &PðPð ð ð2ð 2ð 2ð!ð !ð !ð
#ð 
#ð 
#ð 
#ð!ð !ð !ð
E8ð E8ð E8ðN%ð %ð %ðð ð ðP
ð 
ð 
ð 
ð;ð ;ð ;ðð ð ð&'ð 'ð 'ð 'ð 'r   r   c                 ó¸  ‡‡‡— ddgŠd\  ŠŠˆˆˆfd„}dd„}g }d}t          j        d| ¦  «        D ]•} ||¦  «        r|                     |¦  «         Œ#|                     ¦   «         }|€=t          j        d|¦  «        r(t          j        d	|¦  «                             d
¦  «        }|                      |||¦  «        ¦  «         Œ–d                     |¦  «        S )z<remove the left-whitespace margin of a block of Python code.F)r   r   c                 ó�  •— ‰‰         p‰‰         }t          j        d| ¦  «        rd‰‰<   nd‰‰<   d„ }| r�‰‰         r9 |d‰‰         z  | ¦  «        \  }} |rd‰‰<   ne |d‰‰         z  | ¦  «        \  }} nL |d| ¦  «        \  }} |r|S  |d| ¦  «        \  }} |r|                     d	¦  «        ‰‰<   Œ€ |d
| ¦  «        \  }} | °�|S )NrU   TFc                 ó�   — t          j        | |¦  «        }|r,||t          |                     d¦  «        ¦  «        d …         fS d |fS )Nr   )r   r:   r;   rA   )ÚregÚtÚms      r   r:   z7adjust_whitespace.<locals>.in_multi_line.<locals>.match  sJ   € Ý”˜˜aÑ Ô ˆAØð Ø˜!�C §¢¨¡
¤
™OœOÐ-Ð-Ô.Ð.Ð.à˜Q�w�r   z%sz.*?(?=%s|$)r8   rV   r   z.*?(?=\"\"\"|\'\'\'|#|$))r   r@   rA   )r5   Ústart_stater:   rk   rR   ÚstaterS   s       €€€r   Úin_multi_linez(adjust_whitespace.<locals>.in_multi_line  sA  ø€ Ø˜KÔ(Ð?¨E°,Ô,?ˆåŒ9�V˜TÑ"Ô"ð 	'Ø!%ˆE�+ÑÐà!&ˆE�+Ñð	ð 	ð 	ð ð 	CØ�\Ô"ð CØ˜% ¨¨lÔ(;Ñ ;¸TÑBÔB‘��4Øð PØ*/�E˜,Ñ'Ð'à#˜e N°U¸<Ô5HÑ$HÈ$ÑOÔO‘G�A�t�tà˜%  dÑ+Ô+‘��4Øð 'Ø&Ð&à˜%Ð 0°$Ñ7Ô7‘��4Øð Ø*+¯'ª'°!©*¬*�E˜,Ñ'Øà˜%Ð ;¸TÑBÔB‘��4ð# ð 	Cð& Ðr   rL   c                 ó4   — t          j        d|z  d| ¦  «        S )NrN   rL   )r   rO   )r5   rP   s     r   r?   z'adjust_whitespace.<locals>._indent_line'  s   € ÝŒv�f˜zÑ)¨2¨tÑ4Ô4Ð4r   Nr)   r]   r^   r   r%   ra   )r   r+   r,   r_   r@   r:   rA   Újoin)	Útextrn   r?   r4   rP   r5   rR   rm   rS   s	         @@@r   Úadjust_whitespacerr   ý   s  øøø€ ð �EˆN€EØ"(Ñ€[�,ð"ð "ð "ð "ð "ð "ð "ðH5ð 5ð 5ð 5ð €EØ€Jå”˜ 4Ñ(Ô(ð 9ð 9ˆØˆ=˜ÑÔð 	9Ø�LŠL˜ÑÔÐÐà—?’?Ñ$Ô$ˆDØÐ!¥b¤iÐ0AÀ4Ñ&HÔ&HÐ!ÝœX l°DÑ9Ô9×?Ò?ÀÑBÔB�
Ø�LŠL˜˜ d¨JÑ7Ô7Ñ8Ô8Ð8Ð8Ø�9Š9�UÑÔÐr   )Ú__doc__r   Úmakor   r   rr   re   r   r   ú<module>ru      ss   ðð CÐ Bà 	€	€	€	à Ð Ð Ð Ð Ð ðl'ð l'ð l'ð l'ð l'ñ l'ô l'ð l'ð^8ð 8ð 8ð 8ð 8r   