관리-도구
편집 파일: irc.cpython-38.pyc
U &?�fu � 2 @ s& d Z ddlmZ ddlmZmZmZmZmZm Z m Z mZmZm Z ddlmZ dgZede dedejded ejde jd ejdejdejdejd ejdejdejdejdejdejdede d ejdejdej dej!dejdediZ"dddddddddddddd d d!d"d#d$d%�Z#d&d'� Z$G d(d� de�Z%d)S )*z� pygments.formatters.irc ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for IRC output :copyright: Copyright 2006-2024 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)Z_cyan_Z_brightcyan_)Z_green_Z _brightgreen_)r r )�red� brightred)r r )�yellowr )r r )�**r )z *magenta*z*brightmagenta*)�_brightred_r � � � � � � � � � � � � � � � )�white�blackr r r r r Zoranger ZbrightyellowZ lightgreenr r Z lightbluer r Z brightmagentar r c C s� t | �dk r|S d }}d| kr:|d7 }d| }| �d�} d| kr\|d7 }d| }| �d�} t | �dkr�|dtt| ��d � 7 }d| }|| | S ) Nr r �_��*�r �r �<�>z</)�len�strip�str� IRC_COLOR_MAP�zfill)�color�text�add�sub� r? �Q/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/pygments/formatters/irc.py� ircformatL s rA c @ s8 e Zd ZdZdZddgZg Zdd� Zdd� Zdd � Z d S )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). ZIRC�ircc K sP t j| f|� t|dddgd�dk| _|�dd �p4t| _|�dd�| _d| _d S )N�bgZlightZdark�colorscheme�linenosFr ) r �__init__r �darkbg�get� IRC_COLORSrD rE �_lineno)�self�optionsr? r? r@ rF z s ��zIRCFormatter.__init__c C s( | j r$| jd7 _|�d| j � d S )Nr z%04d: )rE rJ �write)rK �outfiler? r? r@ � _write_lineno� s zIRCFormatter._write_linenoc C s� | � |� |D ]�\}}| j�|�}|d krD|d d� }| j�|�}q"|r�|| j }|�d�}|d d� D ],}|r�|�t||�� |�d� | � |� qh|d r�|�t||d �� q|�|� qd S )N���� )rO rD rH rG �splitrM rA )rK ZtokensourcerN �ttype�valuer; Zspl�liner? r? r@ �format_unencoded� s"