Ë 3 ïä âaßãót—dZddlmZddlmZddlmZddgZGd„d«ZGd „de«Z Gd „de «Z y ) a¿ pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for 256-color terminal output with ANSI sequences. RGB-to-XTERM color conversion routines adapted from xterm256-conv tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) by Wolfgang Frisch. Formatter version 1. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. é)Ú Formatter)Úcodes)Ú ansicolorsÚTerminal256FormatterÚTerminalTrueColorFormattercó,—eZdZdd„Zd„Zd„Zd„Zd„Zy)ÚEscapeSequenceNcóJ—||_||_||_||_||_y©N)ÚfgÚbgÚboldÚ underlineÚitalic)Úselfr r rrrs úD/usr/lib/python3.12/site-packages/pygments/formatters/terminal256.pyÚ__init__zEscapeSequence.__init__#s%€ØˆŒØˆŒØˆŒ Ø"ˆŒØˆ� ócóH—t|«rddj|«zdzSy)Nz[Ú;ÚmÚ)ÚlenÚjoin©rÚattrss rÚescapezEscapeSequence.escape*s$€Ü ˆuŒ:ؘSŸX™X e›_Ñ,¨sÑ2Ð 2Ørc óò—g}|j�v|jtvrCt|jjdd«}d|vrd|_|j |dd«n!|j ddd |jzf«|j�€|jtvrMt|jjdd«}|j tt|dd«d z««n!|j d dd |jzf«|jr|j d «|jr|j d «|jr|j d«|j|«S)NÚansirz;01mTééÚ38Ú5z%ié Ú48Ú01Ú04Ú03) r rrÚreplacerÚappendÚextendr ÚstrÚintrrr)rrÚescs rÚ color_stringzEscapeSequence.color_string/s#€ØˆØ �7‰7Ð Ø�w‰wœ*Ñ$ܘDŸG™GŸO™O¨F°2Ó6Ñ7�ؘS‘=Ø $�D”Ià— ‘ ˜S  1˜XÕ&à— ‘ ˜d C¨°·±©Ð8Ô9Ø �7‰7Ð Ø�w‰wœ*Ñ$ܘDŸG™GŸO™O¨F°2Ó6Ñ7�à— ‘ œS¤ S¨¨1 X£¨rÑ!1Ó2Õ3à— ‘ ˜d C¨°·±©Ð8Ô9Ø �9Š9Ø �L‰L˜Ô Ø �>Š>Ø �L‰L˜Ô Ø �;Š;Ø �L‰L˜Ô Ø�{‰{˜5Ó!Ð!rc óf—g}|jrX|jddt|jd«t|jd«t|jd«f«|jrX|jddt|jd«t|jd«t|jd«f«|jr|j d«|j r|j d«|jr|j d «|j|«S) Nr"Ú2rér r%r&r'r() r r+r,r rr*rrrrs rÚtrue_color_stringz EscapeSequence.true_color_stringIsÕ€ØˆØ �7Š7Ø �L‰L˜$ ¤S¨¯©°©£_´c¸$¿'¹'À!¹*³oÄsÈ4Ï7É7ÐSTÉ:ÃÐWÔ XØ �7Š7Ø �L‰L˜$ ¤S¨¯©°©£_´c¸$¿'¹'À!¹*³oÄsÈ4Ï7É7ÐSTÉ:ÃÐWÔ XØ �9Š9Ø �L‰L˜Ô Ø �>Š>Ø �L‰L˜Ô Ø �;Š;Ø �L‰L˜Ô Ø�{‰{˜5Ó!Ð!rcó—g}|j�|jd«|j�|jd«|js|js |j r|jd«|j |«S)NÚ39Ú49Ú00)r r*r rrrrrs rÚ reset_stringzEscapeSequence.reset_stringWsa€ØˆØ �7‰7Ð Ø �L‰L˜Ô Ø �7‰7Ð Ø �L‰L˜Ô Ø �9Š9˜Ÿš¨$¯+ª+Ø �L‰L˜Ô Ø�{‰{˜5Ó!Ð!r)NNFFF)Ú__name__Ú __module__Ú __qualname__rrr/r3r8©rrr r "s„óòò "ò4 "ó"rr cóP—eZdZdZdZgd¢ZgZd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zy ) raÛ Format tokens with ANSI color sequences, for output in a 256-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly. The formatter takes colors from a style defined by the `style` option and converts them to nearest ANSI 256-color escape sequences. Bold and underline attributes from the style are preserved (and displayed). .. versionadded:: 0.9 .. versionchanged:: 2.2 If the used style defines foreground colors in the form ``#ansi*``, then `Terminal256Formatter` will map these to non extended foreground color. See :ref:`AnsiTerminalStyle` for more information. .. versionchanged:: 2.4 The ANSI color names have been updated with names that are easier to understand and align with colornames of other projects and terminals. See :ref:`this table ` for more information. Options accepted: `style` The style to use, can be a string or a Style subclass (default: ``'default'``). `linenos` Set to ``True`` to have line numbers on the terminal output as well (default: ``False`` = no line numbers). Ú Terminal256)Ú terminal256Ú console256Ú256c ó —tj|fi|¤Žg|_i|_i|_d|v|_d|v|_d|v|_|j«|j«|jdd«|_ d|_ y)NÚnoboldÚ nounderlineÚnoitalicÚlinenosFr) rrÚ xterm_colorsÚ best_matchÚ style_stringÚuseboldÚ useunderlineÚ useitalicÚ_build_color_tableÚ _setup_stylesÚgetrFÚ_lineno)rÚoptionss rrzTerminal256Formatter.__init__‡s‚€Ü×ј4Ñ+ 7Ò+àˆÔ؈ŒØˆÔà wÐ.ˆŒ Ø)°Ð8ˆÔØ#¨7Ð2ˆŒà ×ÑÔ!Ø ×ÑÔà—{‘{ 9¨eÓ4ˆŒ ؈� rcón—|jjd«|jjd«|jjd«|jjd«|jjd«|jjd«|jjd«|jjd«|jjd «|jjd «|jjd «|jjd «|jjd «|jjd«|jjd«|jjd«d}td«D]>}||dzdz}||dzdz}||dz}|jj|||f«Œ@tdd«D](}d|dzz}|jj|||f«Œ*y)N)rrr)éÍrr)rrSr)rSrSr)rréî)rSrrS)rrSrS)éårUrU)érVrV)éÿrr)rrWr)rWrWr)é\rXrW)rWrrW)rrWrW)rWrWrW)ré_é‡é¯é×rWéÙé$ér2éér$)rGr*Úrange)rÚ valuerangeÚiÚrÚgÚbÚvs rrMz'Terminal256Formatter._build_color_table˜sî€ð ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4Ø ×Ñ× Ñ Ð!3Ô4ð:ˆ ä�s–ˆAؘA ™G q™=Ñ)ˆAؘA ™F a™<Ñ(ˆAؘ1˜q™5Ñ!ˆAØ × Ñ × $Ñ $ a¨¨A YÕ /ð ô�q˜"–ˆAØ�A˜‘F‘ ˆAØ × Ñ × $Ñ $ a¨¨A YÕ /ñrcó´—d}d}tdd«D]D}|j|}||dz }||dz } ||dz } ||z| | zz| | zz} | |ksŒA|}| }ŒF|S)Niréþr2r )rbrG) rrerfrgÚdistanceÚmatchrdÚvaluesÚrdÚgdÚbdÚds rÚ_closest_colorz#Terminal256Formatter._closest_color¼s…€ØˆØˆä�q˜#–ˆAØ×&Ñ& qÑ)ˆFà�V˜A‘Y‘ˆBØ�V˜A‘Y‘ˆBØ�V˜A‘Y‘ˆBØ�2‘˜˜2™‘   2¡Ñ%ˆAà�8‹|Ø�Ø‘ððˆ rcó0—|jj|d«}|tvr|}||j|<|€M tt |«d«}|dz dz}|dz dz}|dz}|j |||«}||j|<|S#t $rd}YŒFwxYw)NérrWra)rHrOrr-r,Ú ValueErrorrr)rÚcolorÚindexÚrgbrerfrgs rÚ _color_indexz!Terminal256Formatter._color_indexÍs±€Ø—‘×#Ñ# E¨4Ó0ˆØ ”JÑ àˆEØ%*ˆD�O‰O˜EÑ "Ø ˆ=ð Üœ#˜e›* bÓ)�𘑘dÑ"ˆAؘ‘˜TÑ!ˆAØ�d‘ ˆAØ×'Ñ'¨¨1¨aÓ0ˆEØ%*ˆD�O‰O˜EÑ "؈ øôò Ø’ð ús¹B BÂBcó4—|jD�]\}}t«}|dr|j|d«|_n|dr|j|d«|_|dr|j|d«|_n|dr|j|d«|_|j r |drd|_|jr |drd|_|jr |drd|_ |j«|j«f|jt|«<�Œ y) NÚ ansicolorrvÚ bgansicolorÚbgcolorrTrr)Ústyler ryr r rJrrKrrLrr/r8rIr,©rÚttypeÚndefrs rrNz"Terminal256Formatter._setup_stylesàs€ØŸ:�:‰KˆE�4Ü#Ó%ˆFà�KÒ Ø ×-Ñ-¨d°;Ñ.?Ó@�• Ø�g’Ø ×-Ñ-¨d°7©mÓ<�” Ø�MÒ"Ø ×-Ñ-¨d°=Ñ.AÓB�• Ø�i’Ø ×-Ñ-¨d°9©oÓ>�” Ø�|Š|  V¢ Ø"�” Ø× Ò  T¨+Ò%6Ø#'�Ô Ø�~Š~ $ x¢.Ø $�” Ø-3×-@Ñ-@Ó-BØ-3×-@Ñ-@Ó-Bð-DˆD× Ñ œc %›jÓ )ñ#&rcó˜—|xjdz c_|jd|jdk7xrdxsd|jfz«y)Nr2z%s%04d: Ú r)rPÚwrite)rÚoutfiles rÚ _write_linenoz"Terminal256Formatter._write_linenoõs=€Ø � Š ˜Ñ� Ø� ‰ �j D§L¡L°AÑ$5Ò$>¸$Ò$DÀ"ÀdÇlÁlÐ#SÑSÕTrcó0—tj|||«Sr )rÚformat)rÚ tokensourcer…s rrˆzTerminal256Formatter.formatùs€Ü×Ñ  k°7Ó;Ð;rcóB—|jr|j|«|D]Ä\}}d}|r§|r¥ |jt|«\}}|j d«}|ddD]J} | r|j || z|z«|jr|j|«Œ:|j d«ŒL|dr|j ||dz|z«d}|r|rŒ¥|sŒ´|j |«ŒÆ|jr|j d«yy#t $r|j}YŒQwxYw)NTrƒéÿÿÿÿF)rFr†rIr,Úsplitr„ÚKeyErrorÚparent) rr‰r…r€ÚvalueÚ not_foundÚonÚoffÚsplÚlines rÚformat_unencodedz%Terminal256Formatter.format_unencodedüs€Ø �<Š<Ø × Ñ ˜wÔ 'ã'‰LˆE�5؈IÙ™Ið)à"×/Ñ/´°E³ Ñ;‘G�B˜ð Ÿ+™+ dÓ+�CØ # C R£˜ÙØ#ŸM™M¨"¨t©)°c©/Ô:ØŸ<š<Ø ×.Ñ.¨wÕ7à#ŸM™M¨$Õ/ð !)ð˜2’wØŸ ™  b¨3¨r©7¡l°SÑ&8Ô9à %�Iñ'šIò6Ø— ‘ ˜eÕ$ð=(ð@ �<Š<Ø �M‰M˜$Õ ð øô ò)à!ŸL™L’Eð)ús­BDÄDÄDN)r9r:r;Ú__doc__ÚnameÚaliasesÚ filenamesrrMrrryrNr†rˆr•r<rrrrbsD„ñð@ €DÚ2€GØ€Iòò""0òHò"ò&Dò*Uò<ó% rcó2—eZdZdZdZgd¢ZgZd„Zd„Zd„Z y)ra} Format tokens with ANSI color sequences, for output in a true-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly. .. versionadded:: 2.1 Options accepted: `style` The style to use, can be a string or a Style subclass (default: ``'default'``). ÚTerminalTrueColor)Ú terminal16mÚ console16mÚ16mcó—yr r<)rs rrMz-TerminalTrueColorFormatter._build_color_table7s€Ø rcó€— tt|«d«}|dz dz}|dz dz}|dz}|||fS#t$rYywxYw)NrtrWra)r-r,ru)rrvrxrerfrgs rÚ _color_tuplez'TerminalTrueColorFormatter._color_tuple:s^€ð Ü”c˜%“j "Ó%ˆCð�B‰Y˜$Ñ ˆØ �A‰X˜Ñ ˆØ �$‰JˆØ�1�aˆyÐøô ò Ùð ús ‚1± =¼=có´—|jD]É\}}t«}|dr|j|d«|_|dr|j|d«|_|j r |drd|_|jr |drd|_|jr |drd|_ |j«|j«f|jt|«<ŒËy)Nrvr}rTrr)r~r r¡r r rJrrKrrLrr3r8rIr,rs rrNz(TerminalTrueColorFormatter._setup_stylesDsŀ؟:œ:‰KˆE�4Ü#Ó%ˆFØ�GŠ}Ø ×-Ñ-¨d°7©mÓ<�” Ø�IŠØ ×-Ñ-¨d°9©oÓ>�” Ø�|Š|  V¢ Ø"�” Ø× Ò  T¨+Ò%6Ø#'�Ô Ø�~Š~ $ x¢.Ø $�” Ø-3×-EÑ-EÓ-GØ-3×-@Ñ-@Ó-Bð-DˆD× Ñ œc %›jÒ )ñ&rN) r9r:r;r–r—r˜r™rMr¡rNr<rrrr%s(„ñ ð €DÚ2€GØ€Iò òóDrN) r–Úpygments.formatterrÚpygments.consolerÚpygments.stylerÚ__all__r rrr<rrÚr§sKðñõ2)Ý"Ý%ð "Ð#?Ð @€÷="ñ="ô@ ˜9ô ôF-DÐ!5õ-Dr