HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/site-packages/pip/_vendor/pygments/__pycache__/cmdline.cpython-310.pyc
o

��i�\�@sLdZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZmZmZmZmZmZddlmZddlmZmZdd	lmZm Z m!Z!m"Z"m#Z#dd
l$m%Z%ddl&m'Z'm(Z(ddl)m*Z*m+Z+dd
l,m-Z-m.Z.dd�Z/dd�Z0dd�Z1dd�Z2dd�Z3dd�Z4Gdd�dej5�Z5ej6fdd�Z7dS)z�
    pygments.cmdline
    ~~~~~~~~~~~~~~~~

    Command line interface.

    :copyright: Copyright 2006-2022 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�TerminalTrueColorFormatter)�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)Zo_strs�optsZo_strZo_argsZo_argZo_keyZo_val�r(�G/usr/local/lib/python3.10/site-packages/pip/_vendor/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*)Zf_strs�filtersZf_str�fname�foptsr(r(r)�_parse_filters6sr0c	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)�whatr7�clsr(r(r)�_print_helpCs(	���r>cCs�|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)Nr1zLexers:z~~~~~~~z, r+z(filenames �)�z* %s
    %s %sr2zFormatters:z~~~~~~~~~~~r3zFilters:z~~~~~~~~z* z    %s�stylezStyles:)
r6r�joinr,�sortrr�aliases�	filenamesrrrr )r<�info�fullname�names�exts�_�tup�ir=�docr7r(r(r)�_print_listWsd��
���
�
�rNcCsddl}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)
Nrr1)rDrE�	mimetypes�lexersr2)rDrErM�
formattersr3rMr-rA�styles)�jsonrrrrDrEr7rrrr �dumpr:�stdout)Zrequested_itemsrS�resultrFrGrHrErOr=rMr7r(r(r)�_print_list_as_json�sD�
�

�

�rWc&s�
�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!�} WnNt5�y=}ztd"|tjd�WYd}~dSd}~ww|�slt>j?�d#d�d$v�rSt@d.i|
��}nd%t>j?�d&d�v�retAd.i|
��}ntBd.i|
��}tjCj } |�s�|�rz|
|_DntEtjC�|_D|�s�tjFd'v�r�|jGd(v�r�tH| |jDd)�} d|_DzddlImJmKmL}!Wn
tM�y�Ynw|!jN| ddd*dd+�} |
�d,d�}"tO|"�dk�r�tP|tQ��r�|"d}#|"d}$tR|#|$|�}�j3�s�ztS|||| �W|�r�| �T�dS|�r�| �T�wwzLz6	tjj �U�}%|%�s	n|
�st9|%tj�d}%tS|%||| �tV| d-��r%| �W��q�WW|�r2| �T�dSdStX�yHYW|�rF| �T�dSdSw|�rQ| �T�ww)/NruWPygments version %s, (c) 2006-2022 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�itemsr\)�argnsr\r)�is_only_option�s z"main_inner.<locals>.is_only_option�LrS�r@�-V>r2r3r1rAcSsg|]}|�d��qS)�s)�rstrip�rY�argr(r(r)�
<listcomp>�szmain_inner.<locals>.<listcomp>c3s�|]}|�vVqdSrXr(ri)�
allowed_typesr(r)r^�s�zmain_inner.<locals>.<genexpr>�H)r1r2r3r"r#T�
inencoding�encoding�outencoding)rnrAr4z.pyr+zError: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:�	COLORTERM)�	truecolor�24bit�256�TERM)�win32�cygwin)ZTerminalZTerminal256)roF)�convertr$�	autoreset�wrap�escapeinside�flushr()Y�help�
print_help�Vr6rrd�setr`ra�add�discardr:r;rS�mainr_rNrWrmr>r*�O�Pr%r&�get�NrrrD�C�stdin�buffer�readrr�S�a�f�l�	INPUTFILErZget_style_defsr0�F�bool�x�rsplitrr
rrg�open�	Exceptionrr�gr	�
add_filter�orr�os�environrrrrUror
�platformr7rZpip._vendor.colorama.initialise�_vendorZcoloramaZ
initialise�ImportErrorZwrap_stream�len�
isinstancerrr�close�readline�hasattrr~�KeyboardInterrupt)&�parserrbrcZarg_setrZr[�largsrjr<r7Zparsed_optsZp_opt�valuernrpr1�inpZS_optZa_optZf_optZfmter�errZF_optsZallow_custom_lexer_formatter�	lexername�filename�codeZinfn�infpr.r/Zoutfn�outfileZcolorama_initialiser}�left�right�liner()rlrbr)�
main_inner�sH�

�


�

�

�
��


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


�����������
��
��	����
�r�c@seZdZddd�ZdS)�
HelpFormatterre�NcCsF|durz	t��jd}Wn	tyYnwtj�|||||�dS)Nre)�shutil�get_terminal_size�columnsr��argparser��__init__)�self�prog�indent_increment�max_help_position�widthr(r(r)r�s��zHelpFormatter.__init__)rer�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||�WSty�YdJSt	�yf|j
�rttj
dK�tdLtj
dK�tdMtj
dK�tdNtj
dK�tdOtj
dK�tdLtj
dK�ttj
dK��dJdIl}	|	jt���}
|
dP��}t|
�dQk�rH|dR|
dS�dT�dJ��dHdI�7}ttj
dK�tdUtj
dK�t|tj
dK�tdVtj
dK�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-lZLEXERz~Specify the lexer to use.  (Query names with -L.)  If not given and -g is not present, the lexer is guessed from the filename.)�metavarrz-g�
store_truez`Guess the lexer from the file contents, or pass through as plain text if nothing can be guessed.)�actionrz-FzFILTER[:options]r,znAdd a filter to the token stream.  (Query names with -L.) Filter options are given after a colon if necessary.)r�r�rz-fZ	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-oZ
OUTPUTFILEz8Where to write the output.  Defaults to standard output.r��?z5Where to read the input.  Defaults to standard input.)�nargsrzOperation 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�*ZWHATz�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�rz-NZFILENAMEz�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�storere)�NAMEZTYPEzrPrint detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".)r�r�r�rrfzPrint the package version.z-hz--helpzPrint this help.z-aZARGzKFormatter-specific additional argument for the -S (print style sheet) mode.r#Nrr4zA*****************************************************************z3An unhandled exception occurred while highlighting.z9Please report the whole traceback to the issue tracker atz.<https://github.com/pygments/pygments/issues>.����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��BrokenPipeErrorr�r[r6r:r;�	traceback�format_exception�exc_infor$r�r%)�argsZdescr�Z	operationZlexersel�flagsZspecial_modes_groupZ
special_modesrbr�rF�msgr(r(r)r�s��
��������
���	�������������&��r�)8r8r�r:r�r��textwraprZpip._vendor.pygmentsrr�pip._vendor.pygments.utilrrrrr	r
r�pip._vendor.pygments.lexersrr
rrrrZ#pip._vendor.pygments.lexers.specialrZ%pip._vendor.pygments.formatters.latexrrZpip._vendor.pygments.formattersrrrrrZ(pip._vendor.pygments.formatters.terminalrZ+pip._vendor.pygments.formatters.terminal256rr�pip._vendor.pygments.filtersrr�pip._vendor.pygments.stylesrr r*r0r>rNrWr�r��argvr�r(r(r(r)�<module>s4
$ 
3,Q