Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/pygments/formatters/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/pygments/formatters/__pycache__/irc.cpython-37.pyc

B

ͽ�\��2@s.dZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZddlmZdgZe
dededejd	ed
ejd	ejdejd	ejdejd
ejdejd	ejdejdejdejd	ejdede
d
ejdej dej!dej"dej	de	diZ#ddddddddddddd d!d!d"d#d$d%d&�Z$d'd(�Z%Gd)d�de�Z&dS)*z�
    pygments.formatters.irc
    ~~~~~~~~~~~~~~~~~~~~~~~

    Formatter for IRC output

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�	Formatter)
�Keyword�Name�Comment�String�Error�Number�Operator�Generic�Token�
Whitespace)�get_choice_opt�IRCFormatter)�r)�gray�brightblack)�cyan�
brightcyan)�blue�
brightblue)�magentar)�green�brightgreen)Z_cyan_Z_brightcyan_)Z_green_Z
_brightgreen_)rr)�red�	brightred)rr)�yellowr)rr)z**z**)z	*magenta*z*brightmagenta*)�_brightred_r���������	�
���
��)ZwhiteZblackrrrrrZorangerZbrightyellowZ
lightgreenrrZ	lightbluerrZ
brightmagentarrcCs�t|�dkr|Sd}}d|kr:|d7}d|}|�d�}d|kr\|d7}d|}|�d�}t|�dkr�|dtt|��d	�7}d|}|||S)
Nrr�_��*�r�r�<�>z</)�len�strip�str�
IRC_COLOR_MAP�zfill)�color�text�add�sub�r<�H/opt/alt/python37/lib/python3.7/site-packages/pygments/formatters/irc.py�	ircformatOs 

r>c@s@eZdZdZdZddgZgZdd�Zdd�Zdd	�Z	d
d�Z
dS)
raS
    Format tokens with IRC color sequences

    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 in the output as well
        (default: ``False`` = no line numbers).
    ZIRCZirccKsPtj|f|�t|dddgd�dk|_|�dd�p4t|_|�dd�|_d|_dS)N�bgZlightZdark�colorscheme�linenosFr)	r�__init__r
�darkbg�get�
IRC_COLORSr@rA�_lineno)�self�optionsr<r<r=rB}szIRCFormatter.__init__cCs"|jd7_|�d|j�dS)Nrz
%04d: )rF�write)rG�outfiler<r<r=�
_write_lineno�szIRCFormatter._write_linenoc	Cs�|�|�x�|D]�\}}|�d�r8|�|�|dd�}|j�|�}x$|dkrh|dd�}|j�|�}qFW|r�||j}|�d�}x:|dd�D]*}|�|�|r�|�t||dd���q�W|dr�|�t||d��q|�|�qW|�d�dS)N�
���)rK�endswithr@rDrC�splitrIr>)rG�tokensourcerJ�ttype�valuer8�spl�liner<r<r=�_format_unencoded_with_lineno�s(






z*IRCFormatter._format_unencoded_with_linenocCs�|jr|�||�dSx�|D]�\}}|j�|�}x$|dkrT|dd�}|j�|�}q2W|r�||j}|�d�}x2|dd�D]"}|r�|�t||��|�d�q|W|dr�|�t||d��q|�|�qWdS)NrMrL)rArUr@rDrCrOrIr>)rGrPrJrQrRr8rSrTr<r<r=�format_unencoded�s$


zIRCFormatter.format_unencodedN)�__name__�
__module__�__qualname__�__doc__�name�aliases�	filenamesrBrKrUrVr<r<r<r=rds)'rZ�sysZpygments.formatterrZpygments.tokenrrrrrrr	r
rrZ
pygments.utilr
�__all__ZPreprocZType�WordZBuiltinZFunctionZ	NamespaceZClass�	ExceptionZ	Decorator�VariableZConstant�	AttributeZTagZDeletedZInsertedZHeadingZ
SubheadingrEr6r>rr<r<r<r=�<module>
sf0