Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/pygments/formatters/__pycache__/ |
Upload File : |
o ���a� � @ s� d Z ddlmZ ddlmZmZmZmZmZm Z m Z mZmZm Z ddlmZ dgZi ed�e d�ed�ejd�ed �ejd�e jd �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� pygments.formatters.irc ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for IRC output :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � )� 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)�_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� � lightgreen� r r � � 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 ) Nr$ r �_��*�r �r% )�len�strip�str� IRC_COLOR_MAP�zfill)�color�text�add�sub� rF �9/usr/lib/python3/dist-packages/pygments/formatters/irc.py� ircformatL s rH c @ s@ e Zd ZdZdZddgZg Zdd� Zdd� Zdd � Z d d� Z dS ) r aS 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). �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� IRC_COLORSrN rO �_lineno)�self�optionsrF rF rG rP z s �� zIRCFormatter.__init__c C s"