|edZddlmZddlmZmZmZmZmZm Z m Z m Z m Z m Z ddlmZddlmZdgZie de dedej&d ed ej(d e j*d ej,d ej.d ej0d ej2dej4d ej6dej8dej:dej<d ej>dede d e j@de jBd e jDde jFde jHde jdedi Z%GddeZ&y)z pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. ) Formatter) KeywordNameCommentStringErrorNumberOperatorGenericToken Whitespace) ansiformat)get_choice_optTerminalFormatter)r)gray brightblack)cyan brightcyan)blue brightblue)magenta brightmagenta)green brightgreen)_cyan_ _brightcyan_)_green_ _brightgreen_)rr)red brightred)rr)yellowr")r!r!)**r#)z *magenta*z*brightmagenta*) _brightred_r$c>eZdZdZdZddgZgZdZdZdZ dZ d Z y ) ra Format tokens with ANSI color sequences, for output in a text console. Color sequences are terminated at newlines, so that paging the output works correctly. The `get_style_defs()` method doesn't do anything special since there is no support for common styles. Options accepted: `bg` Set to ``"light"`` or ``"dark"`` depending on the terminal's background (default: ``"light"``). `colorscheme` A dictionary mapping token types to (lightbg, darkbg) color names or ``None`` (default: ``None`` = use builtin colorscheme). `linenos` Set to ``True`` to have line numbers on the terminal output as well (default: ``False`` = no line numbers). Terminalterminalconsolec tj|fi|t|dddgddk(|_|j ddxst |_|j dd|_d|_y)Nbglightdark colorschemelinenosFr) r__init__rdarkbggetTERMINAL_COLORSr-r._lineno)selfoptionss >/usr/lib/python3/dist-packages/pygments/formatters/terminal.pyr/zTerminalFormatter.__init__Ssj4+7+$Wd&-v%6ADJK ";;}d;N{{9e4  c0tj|||SN)rformat)r4 tokensourceoutfiles r6r:zTerminalFormatter.format[sk7;;r7c|xjdz c_|jd|jdk7xrdxsd|jfzy)Nz%s%04d:  r)r3write)r4r<s r6 _write_linenozTerminalFormatter._write_lineno^s=   jDLLA$5$>$$D"dll#SSTr7c|jj|}|*|j}|jj|}|*||jSr9)r-r1parentr0)r4ttypecolorss r6 _get_colorzTerminalFormatter._get_colorbsV!!%%e,nLLE%%))%0Fndkk""r7c |jr|j||D]\}}|j|}|jdD]}|r+|j t ||j dn |j |j d|jdsb|jr|j||j d|jr|j dyy)NTr?)r.rArF splitlinesr@rrstripendswith)r4r;r<rDvaluecolorlines r6format_unencodedz"TerminalFormatter.format_unencodedls <<   w '' ,LE5OOE*E((. ,MM*UDKK4E"FGMM$++d"34==&||**73 d+ , , << MM$  r7N) __name__ __module__ __qualname____doc__namealiases filenamesr/r:rArFrNr7r6rr8s7, D9%GI<U# r7N)'rRpygments.formatterrpygments.tokenrrrrrr r r r r pygments.consoler pygments.utilr__all__PreprocTypeWordBuiltinFunction NamespaceClass Exception DecoratorVariableConstant AttributeTagDeletedInsertedHeading SubheadingPromptr2rrVr7r6rns)111'(    +1 1   OO5   1  LL5 MM9 LL5 MM2 NN7 JJ4 NN5 NN2 MM0  MM0!" NN5#$ HH;%& 2 1 OO9 1 OO, : NN, MM9 ;;BG G r7