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.7/site-packages/pip/_vendor/pygments/__pycache__/cmdline.cpython-37.pyc
B

L��g�\�@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-2023 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|Sx�|D]x}|��s q|�d�}x^|D]V}|��}y$|�dd�\}}|��}|��}Wntk
r|d||<Yq0X|||<q0WqW|S)N�,�=�T)�strip�split�
ValueError)Zo_strs�optsZo_strZo_argsZo_argZo_keyZo_val�r(�@/tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/pygments/cmdline.py�_parse_options!s"


r*cCsZg}|s|SxH|D]@}d|krD|�dd�\}}|�|t|g�f�q|�|if�qW|S)N�:r#)r%�appendr*)Zf_strs�filtersZf_str�fname�foptsr(r(r)�_parse_filters6s
r0c	Cs�y�|dkr0t|�}td|j�tt|j��nX|dkr^t|�}td|j�tt|j��n*|dkr�t|�}td|�tt|j��dSttfk
r�td|t	j
d	�d
SXdS)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)�whatr6�clsr(r(r)�_print_helpCs"r=cCs�|dkr�t�td�td�g}xJt�D]@\}}}}d�|�d||rZdd�|�dp\df}|�|�q*W|��x|D]}td	|�q|W�nR|d
k�r0t�td�td�g}xPt�D]F}t|�}	d�|j�d|	|jr�dd�|j�dp�df}|�|�q�W|��x�|D]}td	|��qWn�|d
k�r�t�td�td�x�t	�D].}
t
|
�}td|
d�tdt|���qXWnZ|dk�r�t�td�td�x8t�D].}
t|
�}td|
d�tdt|���q�WdS)Nr1zLexers:z~~~~~~~z, r+z(filenames �)�z* %s
    %s %sr2zFormatters:z~~~~~~~~~~~r3zFilters:z~~~~~~~~z* z    %s�stylezStyles:)
r5r�joinr,�sortrr�aliases�	filenamesrrrr )r;�info�fullname�names�exts�_�tup�ir<�docr6r(r(r)�_print_listWsR




rMcCsddl}i}d|krHi}x&t�D]\}}}}|||d�||<q W||d<d|kr�i}x,t�D]"}t|�}	|j|j|	d�||j<q\W||d<d|kr�i}x&t�D]}
t|
�}d	t|�i||
<q�W||d
<d|k�ri}x&t	�D]}
t
|
�}d	t|�i||
<q�W||d<|�|tj
�dS)
Nrr1)rCrD�	mimetypesZlexersr2)rCrDrL�
formattersr3rLr-r@Zstyles)�jsonrrrrCrDr6rrrr �dumpr9�stdout)Zrequested_itemsrP�resultrErFrGrDrNr<rLr6r(r(r)�_print_list_as_json�s<
rTc&s 
�jr|��dS�jr(tdt�dS�fdd�}�jdk	�r t�}x&t����D]\}}|rT|�	|�qTW|�
d�|�
d�|r�|�tj�dS�j
s�tdd	g�d
ddd
h�dd��jD�}t�fdd�|D��r�|�tj�dS|s�}�j
�sx |D]}t|��qWnt|�dS�j�rp|d��sB|�tj�dS�j\}}	|dk�rf|�tj�dSt||	�St�j�p|g�}
xR�j�p�gD]B}y|�dd�\}	}Wntk
�r�d|
|<Yn
X||
|	<�q�W|
�d|
�d��}
|
�d|
�d��}�j�r*t�j�}|dk�rt}t|jd�dS�j�r|tjj �!�}yt"||
d�}Wnt#k
�rht}YnXt|jd�dS�j$}�j%}|dk	�r2�j&}|�s�|�tj�dS�j'�s��j(�r�|�tj�dSy||
d
<t)|f|
�}Wn2t#k
�r}zt|tjd�dSd}~XYnXt|�*|�p(d��dS�j%dk	�rN|�tj�dSt+�j,�pZg�}t-�j.�}d}�j'}|�rf|�rd|k�ry\d}d}	d|k�r�|�/dd�\}}	d|	k�r�d}	|�r�|	�r�t0||	f|
�}nt0|f|
�}Wn4t#k
�r}ztd|tjd�dSd}~XYnXnJyt1|f|
�}Wn8t2t#fk
�rd}ztd|tjd�dSd}~XYnXd}�j(�r��j3�r�tdtjd�dS�j(}y"t4|d ��}|�!�}WdQRXWn4t5k
�r�}ztd!|tjd�dSd}~XYnX|
�s�t6|�\}}
|�s:yt7||f|
�}Wn�t#k
�r�}zT�j8�rdyt"|f|
�}Wn t#k
�r`tf|
�}YnXntd|tjd�dSWdd}~XYn4t2k
�r�}ztd|tjd�dSd}~XYnXn|�j3�s"tjj �!�}|
�s�t9|tj�\}}
|�s:yt"|f|
�}Wn t#k
�rtf|
�}YnXn|�s:td"tjd�dSxZ|D]R\}}y|j:|f|�Wn4t#k
�r�}ztd|tjd�dSd}~XYnX�q@W�j;}�j&}|�r�|�rLd|k�rLy\d}d}	d|k�r�|�/dd�\}}	d|	k�r�d}	|�r|	�rt<||	f|
�}nt<|f|
�}Wn4t#k
�rH}ztd|tjd�dSd}~XYnXnJyt)|f|
�}Wn8t2t#fk
�r�}ztd|tjd�dSd}~XYnX|�r2|�s�yt=|f|
�}Wn8t2t#fk
�r�}ztd|tjd�dSd}~XYnXyt4|d#�} Wn4t5k
�r.}ztd$|tjd�dSd}~XYnXnX|�s�t>j?�d%d�d&k�rXt@f|
�}n*d't>j?�d(d�k�rxtAf|
�}n
tBf|
�}tjCj } |�s�|�r�|
|_DntEtjC�|_D|�	s$tjFd)k�	r$|jGd*k�	r$tH| |jDd+�} d|_DyddlImJmKmL}!WntMk
�	rYnX|!jN| ddd,dd-�} |
�d.d�}"tO|"�dk�	rftP|tQ��	rf|"d}#|"d}$tR|#|$|�}�j3�	s�ztS|||| �Wd|�	r�| �T�XdSztyXxRtjj �U�}%|%�	s�P|
�	s�t9|%tj�d}%tS|%||| �tV| d/��	r�| �W��	q�WdStXk
�
rdSXWd|�
r| �T�XdS)0NruWPygments version %s, (c) 2006-2023 by Georg Brandl, Matthäus Chajdas and contributors.cs t�fdd�t����D��S)Nc3s|]\}}|�kr|VqdS)Nr()�.0�k�v)�optr(r)�	<genexpr>�sz5main_inner.<locals>.is_only_option.<locals>.<genexpr>)�any�vars�items)rX)�argns)rXr)�is_only_option�sz"main_inner.<locals>.is_only_option�LrP�r?z-Vr1r2r3r@cSsg|]}|�d��qS)�s)�rstrip)rU�argr(r(r)�
<listcomp>�szmain_inner.<locals>.<listcomp>c3s|]}|�kVqdS)Nr()rUrc)�
allowed_typesr(r)rY�szmain_inner.<locals>.<genexpr>�H)r1r2r3r"r#T�
inencoding�encoding�outencoding)rg)r4z.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:Z	COLORTERM)Z	truecolorZ24bitZ256�TERM)�win32�cygwin)ZTerminalZTerminal256)rhF)�convertr$�	autoreset�wrap�escapeinside�flush)Y�help�
print_help�Vr5rr_�setr[r\�add�discardr9r:rP�mainrZrMrTrfr=r*�O�Pr%r&�get�NrrrC�C�stdin�buffer�readrr�S�a�f�l�	INPUTFILErZget_style_defsr0�F�bool�x�rsplitrr
rra�open�	Exceptionrr�gr	Z
add_filter�orr�os�environrrrrRrhr
�platformr6rZpip._vendor.colorama.initialise�_vendor�colorama�
initialise�ImportError�wrap_stream�len�
isinstancerrr�close�readline�hasattrrs�KeyboardInterrupt)&�parserr]r^Zarg_setrVrW�largsrcr;r6Zparsed_optsZp_opt�valuergrir1�inpZS_optZa_optZf_optZfmter�errZF_optsZallow_custom_lexer_formatterZ	lexername�filename�codeZinfn�infpr.r/Zoutfn�outfileZcolorama_initialiserr�left�right�liner()rer]r)�
main_inner�s�




















r�c@seZdZddd�ZdS)�
HelpFormatterr`�NcCsH|dkr0yt��jd}Wntk
r.YnXtj�|||||�dS)Nr`)�shutil�get_terminal_size�columnsr��argparser��__init__)�self�prog�indent_increment�max_help_position�widthr(r(r)r�szHelpFormatter.__init__)r`r�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��}y
t||�Stk
�r�dJSt	k
�r�|j
�r<tt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�r�|dR|
dS�dT�dJ��dHdI�7}ttj
dK�tdUtj
dK�t|tj
dK�tdVtj
dK�dHSXdIS)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.)�metavarrtz-g�
store_truez`Guess the lexer from the file contents, or pass through as plain text if nothing can be guessed.)�actionrtz-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�rtz-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.)�nargsrtzOperation 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.)rt�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�rtz-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�storer`)�NAMEZTYPEzrPrint detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".)r�r�r�rtz-VzPrint the package version.z-hz--helpzPrint this help.z-aZARGzKFormatter-specific additional argument for the -S (print style sheet) mode.r#Nr)r4zA*****************************************************************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�rWr5r9r:�	traceback�format_exception�exc_infor$r�r%)�args�descr�Z	operationZlexersel�flagsZspecial_modes_groupZ
special_modesr]r�rE�msgr(r(r)rzs�





&
rz)8r7r�r9r�r��textwraprZpip._vendor.pygmentsrrZpip._vendor.pygments.utilrrrrr	r
rZpip._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.terminal256rrZpip._vendor.pygments.filtersrrZpip._vendor.pygments.stylesrr r*r0r=rMrTr�r��argvrzr(r(r(r)�<module>	s2$ 
3,Q