Ë
    �š¾jâ  ã                   ón   — d dl Z d dlmZmZmZ ddlmZmZmZ esdndZ	esdndZ
esd	nd
Z G d„ de«      Zy)é    N)ÚOptionalÚTupleÚUnioné   )ÚNO_UTF8ÚcolorÚsupports_ansiu   â””â”€z|_u   â”œâ”€z|__u   â”€â”€Ú__c                   ó–   — e Zd Zddddd e«       ddfdeeef   d	eeef   d
eeef   dedee   dededefd„Z	dedefd„Z
d„ Zd„ Zd„ Zy)ÚTracebackPrinterÚredÚblueÚyellowé   NéûÿÿÿéþÿÿÿÚcolor_errorÚcolor_tbÚcolor_highlightÚindentÚtb_baseÚ
tb_excludeÚtb_range_startÚtb_range_endc	                 óT  — || _         || _        || _        d|z  | _        |dk(  r=dj	                  t        j                  «       t
        j                  j                  «      }n|�dj	                  |«      }|| _	        t        |«      | _        || _        || _        t        «       | _        y)a‚  Initialize a traceback printer.

        color_error (Union[str, int]): Color name or code for errors.
        color_tb (Union[str, int]): Color name or code for traceback headline.
        color_highlight (Union[str, int]): Color name or code for highlights.
        indent (int): Indentation in spaces.
        tb_base (Optional[str]): Optional name of directory to use to show relative paths. For
            example, "thinc" will look for the last occurence of "/thinc/" in
            a path and only show path to the right of it.
        tb_exclude (tuple): List of filenames to exclude from traceback.
        tb_range_start (int): The starting index from a traceback to include.
        tb_range_end (int): The final index from a traceback to include. If None
            the traceback will continue until the last record.
        RETURNS (TracebackPrinter): The traceback printer.
        ú ú.z{}{}Nz/{}/)r   r   r   r   ÚformatÚosÚgetcwdÚpathÚsepr   Útupler   r   r   r	   )	Úselfr   r   r   r   r   r   r   r   s	            úb/home/spazio/kingdom_calls/work5/transenv/lib/python3.12/site-packages/wasabi/traceback_printer.pyÚ__init__zTracebackPrinter.__init__   sŒ   € ð4 'ˆÔØ ˆŒØ.ˆÔØ˜F‘lˆŒØ�cŠ>Ø—m‘m¤B§I¡I£K´·±·±Ó=‰GØÐ Ø—m‘m GÓ,ˆGØˆŒÜ 
Ó+ˆŒØ,ˆÔØ(ˆÔÜ*›_ˆÕó    ÚtitleÚreturnc                 ón  — |j                  dd«      }|j                  dd«      }| j                  rt        || j                  d¬«      }|r/ddj	                  |D �cg c]  }| j
                  |z   ‘Œ c}«      z   nd}|r| j                  ||«      nd}d	j                  | j
                  |||«      }|S c c}w )
a  Output custom formatted tracebacks and errors.

        title (str): The message title.
        *texts (str): The texts to print (one per line).
        RETURNS (str): The formatted traceback. Can be printed or raised
            by custom exception.
        Ú	highlightFÚtbNT©ÚfgÚboldú
Ú z

{}{}{}{}
)Úgetr	   r   r   Újoinr   Ú_get_tracebackr   )	r$   r(   ÚtextsÚsettingsr+   r,   ÚtextÚinfoÚmsgs	            r%   Ú__call__zTracebackPrinter.__call__4   s¨   € ð —L‘L ¨eÓ4ˆ	Ø�\‰\˜$ Ó%ˆØ×ÒÜ˜% D×$4Ñ$4¸4Ô@ˆEÙKPˆt�d—i‘iÀÖ F¸ §¡¨tÓ!3Ò FÓGÒGÐVXˆÙ35ˆT× Ñ   YÔ/¸2ˆØ×%Ñ% d§k¡k°5¸$ÀÓCˆØˆ
ùò !Gs   ÁB2
c                 ó4  — |D �cg c]#  }|d   j                  | j                  «      rŒ"|‘Œ% }}| j                  �|| j                  | j                   n|| j                  d  }t	        |«      D �����	cg c]*  \  }\  }}}}	| j                  ||||	|t        |«      |«      ‘Œ, }
}}}}}	dj                  |
«      j                  «       }d}| j                  rt        || j                  d¬«      }dj                  ||| j                  ¬«      S c c}w c c}	}}}}w )Nr   r0   z
Traceback:Tr-   z

{indent}{title}
{indent}{tb})r(   r,   r   )Úendswithr   r   r   Ú	enumerateÚ_format_tracebackÚlenr3   Ústripr	   r   r   r   r   )r$   r,   r+   ÚrecordÚtb_rangeÚir!   ÚlineÚfnr7   Útb_listÚtb_datar(   s                r%   r4   zTracebackPrinter._get_tracebackE   s  € à#%ÖQ˜¨V°A©Y×-?Ñ-?ÀÇÁÕ-PŠfÐQˆÐQð × Ñ Ð,ð ˆt×"Ñ" T×%6Ñ%6Ñ7à�D×'Ñ'Ð)Ð*ð 	ô .7°xÓ-@÷
ò 
á)�Ñ)�D˜$  Dð ×"Ñ" 4¨¨r°4¸¼CÀ»MÈ9ÕUð
ˆô 
ð —)‘)˜GÓ$×*Ñ*Ó,ˆØˆØ×ÒÜ˜% D§M¡M¸Ô=ˆEØ2×9Ñ9Ø˜G¨D¯K©Kð :ó 
ð 	
ùò Rùö
s   …#D©DÁ4/Dc                 ó|  — d}||dz
  k(  rt         nt        t        |z  z   }	| j                  r-| j                  |v r|j	                  | j                  d«      d   }||dz
  k(  r| j                  |||«      nd}| j                  rt        |d¬«      }t        |d¬«      }|j                  | j                  ||	|||¬«      S )Nz1{base_indent}{indent} {fn} in {path}:{line}{text}r   r1   T)r/   )Ú	underline)Úbase_indentrD   r   r7   rE   r!   )
Ú	LINE_EDGEÚ	LINE_FORKÚ	LINE_PATHr   ÚrsplitÚ_format_user_errorr	   r   r   r   )
r$   r!   rD   rE   r7   rC   Úcountr+   Útemplater   s
             r%   r>   z"TracebackPrinter._format_tracebackY   sº   € ØFˆØ  E¨A¡Iš~•)´9Ä	ÈAÁÑMˆØ�<Š<˜DŸL™L¨DÑ0Ø—;‘;˜tŸ|™|¨QÓ/°Ñ2ˆDØ>?À5È1Á9ºnˆt×&Ñ& t¨Q°	Ô:ÐRTˆØ×ÒÜ�r Ô%ˆBÜ˜¨Ô.ˆDØ�‰ØŸ™ØØØØØð ó 
ð 	
r'   c                 ó   — d|z  dz   }| j                   rt        || j                  ¬«      }|r5| j                   r)t        || j                  ¬«      }|j	                  ||«      }dj                  | j                  ||«      S )Nz  z >>>)r.   z

{}  {} {})r	   r   r   r   Úreplacer   r   )r$   r7   rC   r+   ÚspacingÚformatted_highlights         r%   rO   z#TracebackPrinter._format_user_errork   ss   € Ø˜‘(˜VÑ#ˆØ×ÒÜ˜G¨×(8Ñ(8Ô9ˆGÙ˜×+Ò+Ü"'¨	°d×6JÑ6JÔ"KÐØ—<‘< 	Ð+>Ó?ˆDØ×#Ñ# D§K¡K°¸$Ó?Ð?r'   )Ú__name__Ú
__module__Ú__qualname__r#   r   ÚstrÚintr   r   r&   r:   r4   r>   rO   © r'   r%   r   r      s±   „ ð (-Ø$*Ø+3ØØ!%Ù!›GØ Øñ&-à˜3 ˜8‘_ð&-ð ˜˜S˜‘/ð&-ð ˜s C˜x™ð	&-ð
 ð&-ð ˜#‘ð&-ð ð&-ð ð&-ð ó&-ðP˜cð ¸#ó ò"
ò(
ó$@r'   r   )r   Útypingr   r   r   Úutilr   r   r	   rK   rL   rM   Úobjectr   r[   r'   r%   ú<module>r_      s?   ðÛ 	ß )Ñ )ç /Ñ /á#‰H¨€	Ù#‰H¨€	Ù#‰H¨€	ôg@�võ g@r'   