irc.pyc
1 o 2 ��cQ � @ s� d Z ddlmZ ddlmZmZmZmZmZm Z m 3 Z 4 mZmZm Z ddlmZ dgZi ed�e d�ed�ejd�ed �ejd�e 5 jd 6 �ejd�ejd�ejd�ejd �ejd�ejd�ejd�ejd�ejd�ejd�ede d ejdejdej dej!dejdedi�Z"i dd�dd�dd�dd�dd�dd �d!d"�d#d$�d%d$�d&d'�d(d)�d*d)�d+d,�d-d.�d/d.�d0d1�d2d3�d4d5d��Z#d6d7� Z$G d8d� de�Z%d9S ):z� 7 pygments.formatters.irc 8 ~~~~~~~~~~~~~~~~~~~~~~~ 9 10 Formatter for IRC output 11 12 :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. 13 :license: BSD, see LICENSE for details. 14 � )� Formatter) 15 �Keyword�Name�Comment�String�Error�Number�Operator�Generic�Token� 16 Whitespace)�get_choice_opt�IRCFormatter)� r )�gray�brightblack)�cyan� 17 brightcyan)�blue� 18 brightblue)�magentar )�green�brightgreen)�_cyan_�_brightcyan_)�_green_� _brightgreen_)r r )�red� brightred)r r )�yellowr )r r )�**r )z *magenta*z*brightmagenta*)�_brightred_r! �white�black� r � r � r � r � r � �orange� r �brightyellow� � 19 lightgreen� r r � 20 � lightblue� r r � � brightmagenta� � � c C s� t | �dk r|S d }}d| v r|d7 }d| }| �d�} d| v r.|d7 }d| }| �d�} t | �dkrE|dtt| ��d � 7 }d| }|| | S ) 21 Nr$ r �_��*�r �r% )�len�strip�str� IRC_COLOR_MAP�zfill)�color�text�add�sub� rF ��C:\Users\Jacks.GUTTSPC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pygments\formatters\irc.py� ircformatL s 22 23 rH c @ s8 e Zd ZdZdZddgZg Zdd� Zdd� Zdd � Z d 24 S )r aS 25 Format tokens with IRC color sequences 26 27 The `get_style_defs()` method doesn't do anything special since there is 28 no support for common styles. 29 30 Options accepted: 31 32 `bg` 33 Set to ``"light"`` or ``"dark"`` depending on the terminal's background 34 (default: ``"light"``). 35 36 `colorscheme` 37 A dictionary mapping token types to (lightbg, darkbg) color names or 38 ``None`` (default: ``None`` = use builtin colorscheme). 39 40 `linenos` 41 Set to ``True`` to have line numbers in the output as well 42 (default: ``False`` = no line numbers). 43 �IRC�ircc K sT t j| fi |�� t|dddgd�dk| _|�dd �pt| _|�dd�| _d| _d S )N�bg�light�dark�colorscheme�linenosFr ) r �__init__r �darkbg�get� 44 IRC_COLORSrN rO �_lineno)�self�optionsrF rF rG rP z s �� 45 zIRCFormatter.__init__c C s, | j r| jd7 _|�d| j � d S d S )Nr$ z%04d: )rO rT �write)rU �outfilerF rF rG � _write_lineno� s �zIRCFormatter._write_linenoc C s� | � |� |D ][\}}| j�|�}|d u r%|d d� }| j�|�}|d u s|r]|| j }|�d�}|d d� D ]}|rC|�t||�� |�d� | � |� q7|d r\|�t||d �� q|�|� qd S )N������ 46 )rY rN rR rQ �splitrW rH )rU �tokensourcerX �ttype�valuerB �spl�linerF rF rG �format_unencoded� s( 47 � 48 49 50 ��zIRCFormatter.format_unencodedN) 51 �__name__� 52 __module__�__qualname__�__doc__�name�aliases� filenamesrP rY rb rF rF rF rG r a s N)&rf �pygments.formatterr �pygments.tokenr r r r r r r r 53 r r � pygments.utilr �__all__�Preproc�Type�Word�Builtin�Function� Namespace�Class� Exception� Decorator�Variable�Constant� Attribute�Tag�Deleted�Inserted�Heading� 54 SubheadingrS r@ rH r rF rF rF rG �<module> s� 55 0������� � 56 ��� ������� �������� � 57 ��� ������