https://t.me/RX1948
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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/pygments/__pycache__/cmdline.cpython-310.pyc
o

���a�Z�@sHdZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZmZmZmZmZmZddlmZddlmZmZdd	lmZm Z m!Z!m"Z"m#Z#dd
l$m%Z%ddl&m'Z'ddl(m)Z)m*Z*dd
l+m,Z,m-Z-dd�Z.dd�Z/dd�Z0dd�Z1dd�Z2dd�Z3Gdd�dej4�Z4ej5fdd�Z6dS)z�
    pygments.cmdline
    ~~~~~~~~~~~~~~~~

    Command line interface.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�dedent)�__version__�	highlight)�
ClassNotFound�OptionError�docstring_headline�guess_decode�guess_decode_from_terminal�terminal_encoding�UnclosingTextIOWrapper)�get_all_lexers�get_lexer_by_name�guess_lexer�load_lexer_from_file�get_lexer_for_filename�find_lexer_class_for_filename)�	TextLexer)�LatexEmbeddedLexer�LatexFormatter)�get_all_formatters�get_formatter_by_name�load_formatter_from_file�get_formatter_for_filename�find_formatter_class)�TerminalFormatter)�Terminal256Formatter)�get_all_filters�find_filter_class)�get_all_styles�get_style_by_namec
Cs�i}|s|S|D]9}|��sq|�d�}|D]*}|��}z|�dd�\}}|��}|��}Wn
ty;d||<Yqw|||<qq|S)N�,�=�T)�strip�split�
ValueError)�o_strs�opts�o_str�o_args�o_arg�o_key�o_val�r-�2/usr/lib/python3/dist-packages/pygments/cmdline.py�_parse_options!s&
�
�
r/cCsVg}|s|S|D] }d|vr!|�dd�\}}|�|t|g�f�q|�|if�q|S)N�:r")r$�appendr/)�f_strs�filters�f_str�fname�foptsr-r-r.�_parse_filters6sr7c	Cs�zJ|dkrt|�}td|j�tt|j��WdS|dkr3t|�}td|j�tt|j��WdS|dkrHt|�}td|�tt|j��WdSttfy_td|t	j
d	�Yd
Sw)N�lexerzHelp on the %s lexer:�	formatterzHelp on the %s formatter:�filterzHelp on the %s filter:rz
%s not found!��filer")r
�print�namer�__doc__rr�AttributeErrorr%�sys�stderr)�whatr>�clsr-r-r.�_print_helpCs(	���rEcCs�|dkrFt�td�td�g}t�D] \}}}}d�|�d||r,dd�|�dp-df}|�|�q|��|D]}td	|�q;dS|d
kr�t�td�td�g}t�D]#}t|�}	d�|j�d|	|jrudd�|j�dpvdf}|�|�qZ|��|D]}td	|�q�dS|d
kr�t�td�td�t	�D]}
t
|
�}td|
d�tdt|��q�dS|dkr�t�td�td�t�D]}
t|
�}td|
d�tdt|��q�dSdS)Nr8zLexers:z~~~~~~~z, r0z(filenames �)�z* %s
    %s %sr9zFormatters:z~~~~~~~~~~~r:zFilters:z~~~~~~~~z* z    %s�stylezStyles:)
r=r�joinr1�sortrr�aliases�	filenamesrrrr)rC�info�fullname�names�exts�_�tup�irD�docr>r-r-r.�_print_listWsd��
���
�
�rUcCsddl}i}d|vr"i}t�D]\}}}}|||d�||<q||d<d|vrAi}t�D]}t|�}	|j|j|	d�||j<q+||d<d|vr]i}t�D]}
t|
�}d	t|�i||
<qJ||d
<d|vryi}t	�D]}
t
|
�}d	t|�i||
<qf||d<|�|tj
�dS)
Nrr8)rKrL�	mimetypes�lexersr9)rKrLrT�
formattersr:rTr3rH�styles)�jsonrrrrKrLr>rrrr�dumprA�stdout)�requested_itemsrZ�resultrMrNrOrLrVrDrTr>r-r-r.�_print_list_as_json�sD�
�

�

�r_c&sr
�jr	|��dS�jrtdt�dS�fdd�}�jdur�t�}t����D]\}}|r3|�	|�q(|�
d�|�
d�|rH|�tj�dS�j
sQtdd	g�hd
��dd��jD�}t�fd
d�|D��rp|�tj�dS|st�}�j
s�|D]}t|�qydSt|�dS�jr�|d�s�|�tj�dS�j\}}	|dvr�|�tj�dSt||	�St�jp�g�}
�jp�gD]}z
|�dd�\}	}Wn
ty�d|
|<Yq�w||
|	<q�|
�d|
�d��}
|
�d|
�d��}�j�rt�j�}|dur�t}t|jd�dS�j�r*tjj �!�}zt"||
d�}Wnt#�y t}Ynwt|jd�dS�j$}�j%}|du�r��j&}|�sC|�tj�dS�j'�sK�j(�rS|�tj�dSz||
d<t)|fi|
��}Wnt#�y|}zt|tjd�WYd}~dSd}~wwt|�*|�p�d��dS�j%du�r�|�tj�dSt+�j,�p�g�}t-�j.�}d}�j'}|�r,|�rd|v�rz2d}d}	d|v�r�|�/dd�\}}	d|	v�r�d}	|�r�|	�r�t0||	fi|
��}nt0|fi|
��}WnEt#�y}ztd|tjd�WYd}~dSd}~wwz
t1|fi|
��}Wnt2t#f�y+}ztd|tjd�WYd}~dSd}~wwd}�j(�r�j3�r?tdtjd�dS�j(}zt4|d��}|�!�}Wd�n	1�sXwYWnt5�yz}ztd|tjd�WYd}~dSd}~ww|
�s�t6|�\}}
|�s�zt7||fi|
��}Wn�t#�y�}z5�j8�r�z
t"|fi|
��}Wn t#�y�td,i|
��}Ynwtd|tjd�WYd}~dSWYd}~nbd}~wt2�y�}ztd|tjd�WYd}~dSd}~wwnA�j3�s&tjj �!�}|
�st9|tj�\}}
|�s%z
t"|fi|
��}Wnt#�y$td,i|
��}Ynwn|�s2td tjd�dS|D]-\}}z|j:|fi|��W�q4t#�ya}ztd|tjd�WYd}~dSd}~ww�j;}�j&}|�r�|�r�d|v�r�z2d}d}	d|v�r�|�/dd�\}}	d|	v�r�d}	|�r�|	�r�t<||	fi|
��}nt<|fi|
��}WnEt#�y�}ztd|tjd�WYd}~dSd}~wwz
t)|fi|
��}Wnt2t#f�y�}ztd|tjd�WYd}~dSd}~ww|�r>|�sz
t=|fi|
��}Wnt2t#f�y}ztd|tjd�WYd}~dSd}~wwzt4|d!�} Wn<t5�y=}ztd"|tjd�WYd}~dSd}~ww|�sZd#t>j?�d$d�v�rSt@d,i|
��}ntAd,i|
��}tjBj } |�sn|�rh|
|_CntDtjB�|_C|�s�tjEd%v�r�|jFd&v�r�tG| |jCd'�} d|_CzddlH}!Wn
tI�y�Ynw|!jJjK| ddd(dd)�} |
�d*d�}"tL|"�dk�r�tM|tN��r�|"d}#|"d}$tO|#|$|�}�j3�s�ztP|||| �W|�r�| �Q�dS|�r�| �Q�wwzLz6	tjj �R�}%|%�s�n|
�s�t9|%tj�d}%tP|%||| �tS| d+��r| �T��q�WW|�r| �Q�dSdStU�y/YW|�r-| �Q�dSdSw|�r8| �Q�ww)-NruWPygments version %s, (c) 2006-2021 by Georg Brandl, Matthäus Chajdas and contributors.cs t�fdd�t����D��S)Nc3s �|]\}}|�kr|VqdS�Nr-)�.0�k�v��optr-r.�	<genexpr>�s�z5main_inner.<locals>.is_only_option.<locals>.<genexpr>)�any�vars�itemsrd)�argnsrdr.�is_only_option�s z"main_inner.<locals>.is_only_option�LrZ�rG�-V>r8rHr:r9cSsg|]}|�d��qS)�s)�rstrip�ra�argr-r-r.�
<listcomp>�szmain_inner.<locals>.<listcomp>c3s�|]}|�vVqdSr`r-rq)�
allowed_typesr-r.rf�s�zmain_inner.<locals>.<genexpr>�H)r8r9r:r!r"T�
inencoding�encoding�outencoding)rvrHr;z.pyr0zError:z5Error: -s option not usable when input file specified�rbzError: cannot read infile:z7Error: when using -s a lexer has to be selected with -l�wbzError: cannot open outfile:�256�TERM)�win32�cygwin)�Terminal�Terminal256)rwF)�convertr#�	autoreset�wrap�escapeinside�flushr-)V�help�
print_help�Vr=rrl�setrhri�add�discardrArBrZ�mainrgrUr_rurEr/�O�Pr$r%�get�NrrrK�C�stdin�buffer�readrr�S�a�f�l�	INPUTFILEr�get_style_defsr7�F�bool�x�rsplitrr
rro�open�	Exceptionrr�gr	�
add_filter�orr�os�environrrr\rwr
�platformr>r�colorama.initialise�ImportError�
initialise�wrap_stream�len�
isinstancerrr�close�readline�hasattrr��KeyboardInterrupt)&�parserrjrk�arg_setrbrc�largsrrrCr>�parsed_opts�p_opt�valuervrxr8�inp�S_opt�a_opt�f_opt�fmter�err�F_opts�allow_custom_lexer_formatter�	lexername�filename�code�infn�infpr5r6�outfn�outfile�coloramar��left�right�liner-)rtrjr.�
main_inner�sD�

�


�

�

�
��



�������
��������������


�����������
��
��	����
�r�c@seZdZddd�ZdS)�
HelpFormatterrm�NcCsF|durz	t��jd}Wn	tyYnwtj�|||||�dS)Nrm)�shutil�get_terminal_size�columnsr��argparser��__init__)�self�prog�indent_increment�max_help_position�widthr-r-r.r�s��zHelpFormatter.__init__)rmr�N)�__name__�
__module__�__qualname__r�r-r-r-r.r�sr�cCs�d}tj|dtd�}|�d�}|��}|jdddd�|jd	d
dd�|jd
dddd�|jdddd�|jddddd�|jddddd�|jdddd�|jddd d!�|�d"�}|jd#d
d$d�|jd%d
d&d�|jd'd
d(d�|jd)d*dd
d+�|�d,�}|��}|jd-d.d/d�|jd0d1d2d3d4�|jd5d6d7d�|jd8d
d9d�|jd:d;d<d=d>d?�|jd@d
dAd�|jdBdCd
dDd�|jdEdFdGd�|�|dHdI��}zt||�WSt�y]|j	�rt
tjdJ�t
dKtjdJ�t
dLtjdJ�t
dMtjdJ�t
dNtjdJ�t
dKtjdJ�t
tjdJ��dOdIl
}	|	jt���}
|
dP��}t|
�dQk�r?|dR|
dS�dT�dO��dHdI�7}t
tjdJ�t
dUtjdJ�t
|tjdJ�t
dVtjdJ�YdHSw)Wz(
    Main command line entry point.
    z?Highlight an input file and write the result to an output file.F)�description�add_help�formatter_classzMain operationz-l�LEXERz~Specify the lexer to use.  (Query names with -L.)  If not given and -g is not present, the lexer is guessed from the filename.)�metavarr�z-g�
store_truez`Guess the lexer from the file contents, or pass through as plain text if nothing can be guessed.)�actionr�z-FzFILTER[:options]r1znAdd a filter to the token stream.  (Query names with -L.) Filter options are given after a colon if necessary.)r�r�r�z-f�	FORMATTERz�Specify the formatter to use.  (Query names with -L.) If not given, the formatter is guessed from the output filename, and defaults to the terminal formatter if the output is to the terminal or an unknown file extension.z-OzOPTION=value[,OPTION=value,...]zyGive options to the lexer and formatter as a comma-separated list of key-value pairs. Example: `-O bg=light,python=cool`.z-PzOPTION=valuez�Give a single option to the lexer and formatter - with this you can pass options whose value contains commas and equal signs. Example: `-P "heading=Pygments, the Python highlighter"`.z-o�
OUTPUTFILEz8Where to write the output.  Defaults to standard output.r��?z5Where to read the input.  Defaults to standard input.)�nargsr�zOperation flagsz-vzbPrint a detailed traceback on unhandled exceptions, which is useful for debugging and bug reports.z-sa!Process lines one at a time until EOF, rather than waiting to process the entire file.  This only works for stdin, only for lexers with no line-spanning constructs, and is intended for streaming input such as you get from `tail -f`. Example usage: `tail -f sql.log | pygmentize -s -l sql`.z-xa�Allow custom lexers and formatters to be loaded from a .py file relative to the current working directory. For example, `-l ./customlexer.py -x`. By default, this option expects a file with a class named CustomLexer or CustomFormatter; you can also specify your own class name with a colon (`-l ./lexer.py:MyLexer`). Users should be very careful not to use this option with untrusted files, because it will import and run them.z--jsonz=Output as JSON. This can be only used in conjunction with -L.)r��defaultr�z*Special modes - do not do any highlightingz-SzSTYLE -f formatterzqPrint style definitions for STYLE for a formatter given with -f. The argument given by -a is formatter dependent.z-L�*�WHATz�List lexers, formatters, styles or filters -- give additional arguments for the thing(s) you want to list (e.g. "styles"), or omit them to list everything.)r�r�r�z-N�FILENAMEz�Guess and print out a lexer name based solely on the given filename. Does not take input or highlight anything. If no specific lexer can be determined, "text" is printed.z-CzXLike -N, but print out a lexer name based solely on a given content from standard input.z-H�storerm)�NAME�TYPEzrPrint detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".)r�r�r�r�rnzPrint the package version.z-hz--helpzPrint this help.z-a�ARGzKFormatter-specific additional argument for the -S (print style sheet) mode.r"Nr;zA*****************************************************************z3An unhandled exception occurred while highlighting.z9Please report the whole traceback to the issue tracker atz.<https://github.com/pygments/pygments/issues>.r����z	
   (f%s)����
z*** Error while highlighting:z>*** If this is a bug you want to report, please rerun with -v.)r��ArgumentParserr��add_argument_group�add_mutually_exclusive_group�add_argument�
parse_argsr�r�rcr=rArB�	traceback�format_exception�exc_infor#r�r$)�args�descr��	operation�lexersel�flags�special_modes_group�
special_modesrjr�rM�msgr-r-r.r�s��
��������
���	�������������&��r�)7r?r�rAr�r��textwrapr�pygmentsrr�
pygments.utilrrrrr	r
r�pygments.lexersrr
rrrr�pygments.lexers.specialr�pygments.formatters.latexrr�pygments.formattersrrrrr�pygments.formatters.terminalr�pygments.formatters.terminal256r�pygments.filtersrr�pygments.stylesrrr/r7rErUr_r�r��argvr�r-r-r-r.�<module>s4
$ 
3,O

https://t.me/RX1948 - 2025