3

V'ícMã@sDdZddlZddlmZddlmZdgZdd„ZGdd„dƒZdS)	z¾
    pygments.formatter
    ~~~~~~~~~~~~~~~~~~

    Base formatter class.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
éN)Úget_bool_opt)Úget_style_by_nameÚ	FormattercCst|tƒrt|ƒS|S)N)Ú
isinstanceÚstrr)Ústyle©rú6/tmp/pip-build-gk9425m9/Pygments/pygments/formatter.pyÚ
_lookup_styles
r
c@s:eZdZdZdZgZgZdZdd„Zddd„Z	d	d
„Z
dS)raŒ
    Converts a token stream to text.

    Options accepted:

    ``style``
        The style to use, can be a string or a Style subclass
        (default: "default"). Not used by e.g. the
        TerminalFormatter.
    ``full``
        Tells the formatter to output a "full" document, i.e.
        a complete self-contained document. This doesn't have
        any effect for some formatters (default: false).
    ``title``
        If ``full`` is true, the title that should be used to
        caption the document (default: '').
    ``encoding``
        If given, must be an encoding name. This will be used to
        convert the Unicode token strings to byte strings in the
        output. If it is "" or None, Unicode strings will be written
        to the output file, which most file-like objects do not
        support (default: None).
    ``outencoding``
        Overrides ``encoding`` if given.
    NTcKslt|jddƒƒ|_t|ddƒ|_|jddƒ|_|jddƒp<d|_|jdkrPd
|_|jdƒp^|j|_||_dS)
NrÚdefaultÚfullFÚtitleÚÚencodingÚguessÚchardetzutf-8Zoutencoding)rr)r
Úgetrrrr
rÚoptions)Úselfrrrr	Ú__init__As
zFormatter.__init__rcCsdS)a
        Return the style definitions for the current style as a string.

        ``arg`` is an additional argument whose meaning depends on the
        formatter used. Note that ``arg`` can also be a list or tuple
        for some formatters like the html formatter.
        rr)rÚargrrr	Úget_style_defsLszFormatter.get_style_defscCs&|jrtj|jƒd|ƒ}|j||ƒS)zƒ
        Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
        tuples and write it into ``outfile``.
        é)rÚcodecsÚlookupZformat_unencoded)rZtokensourceÚoutfilerrr	ÚformatVszFormatter.format)r)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesZ
unicodeoutputrrrrrrr	rs

)	r rZ
pygments.utilrZpygments.stylesrÚ__all__r
rrrrr	Ú<module>	s