Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/pip/_vendor/pygments/formatters/__pycache__/terminal.cpython-37.pyc
Назад
B �5�gB � 4 @ s d Z ddlmZ ddlmZmZmZmZmZm Z m Z mZmZm Z ddlmZ ddlmZ dgZede dedejd ed ejd e jdejd ejdejd ejdejd ejdejdejdejd ejdede d ej dej!dej"dej#dej$dejdediZ%G dd� de�Z&dS )z� pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � )� Formatter) �Keyword�Name�Comment�String�Error�Number�Operator�Generic�Token� Whitespace)� ansiformat)�get_choice_opt�TerminalFormatter)� r )�gray�brightblack)ZcyanZ brightcyan)Zblue� brightblue)ZmagentaZ brightmagenta)ZgreenZbrightgreen)Z_cyan_Z_brightcyan_)Z_green_Z _brightgreen_)r r )Zred� brightred)r r )�yellowr )r r )z**z**)z *magenta*z*brightmagenta*)�_brightred_r c @ sH e Zd ZdZdZddgZg Zdd� Zdd� Zd d � Z dd� Z d d� ZdS )r a� Format tokens with ANSI color sequences, for output in a text console. Color sequences are terminated at newlines, so that paging the output works correctly. 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 on the terminal output as well (default: ``False`` = no line numbers). ZTerminalZterminal�consolec K sP t j| f|� t|dddgd�dk| _|�dd �p4t| _|�dd�| _d| _d S )N�bg�lightZdark�colorscheme�linenosFr ) r �__init__r �darkbg�get�TERMINAL_COLORSr r �_lineno)�self�options� r# �I/tmp/pip-install-251nq386/pip/pip/_vendor/pygments/formatters/terminal.pyr S s zTerminalFormatter.__init__c C s t �| ||�S )N)r �format)r! �tokensource�outfiler# r# r$ r% [ s zTerminalFormatter.formatc C s4 | j d7 _ |�d| j dkr"dp$d| j f � d S )N� z%s%04d: � r )r �write)r! r'