Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/cmdline.cpython-312.pyc

�

4Μgh\��h�dZddlZddlZddlZddlZddlmZddlmZm	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.d�Z/d�Z0d�Z1d�Z2d�Z3d�Z4Gd�dejj�Z5ejlfd�Z7y)z�
    pygments.cmdline
    ~~~~~~~~~~~~~~~~

    Command line interface.

    :copyright: Copyright 2006-2024 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�0�i}|s|S|D]v}|j�s�|jd�}|D]M}|j�}	|jdd�\}}|j�}|j�}|||<�O�x|S#t$rd||<Y�dwxYw)N�,�=�T)�strip�split�
ValueError)�o_strs�opts�o_str�o_args�o_arg�o_key�o_vals       �G/usr/local/lib/python3.12/site-packages/pip/_vendor/pygments/cmdline.py�_parse_optionsr1!s���
�D�������{�{�}�����S�!���E��K�K�M�E�
$�$�{�{�3��2���u����
�����
��$��U���	��K��	�
#�"��U��
#�s�5B�B�Bc��g}|s|S|D]L}d|vr3|jdd�\}}|j|t|g�f��:|j|if��N|S)N�:r%)r'�appendr1)�f_strs�filters�f_str�fname�foptss     r0�_parse_filtersr:6sc���G�������%�<� �;�;�s�A�.�L�E�5��N�N�E�>�5�'�#:�;�<��N�N�E�2�;�'���N�c��	|dk(rCt|�}td|j�d��tt|j��y|dk(rCt|�}td|j�d��tt|j��y|dk(r8t
|�}td|�d��tt|j��y#ttf$r!t|�d	�tj�
�YywxYw)N�lexerzHelp on the z lexer:�	formatterz formatter:�filterz filter:rz not found!��filer%)r�print�namer�__doc__rr�AttributeErrorr(�sys�stderr)�whatrC�clss   r0�_print_helprJCs�����7�?�#�D�)�C��L����
�'�2�3��&����%�&���[�
 �&�t�,�C��L����
�+�6�7��&����%�&�
�	�X�
�#�D�)�C��L���h�/�0��&����%�&����J�'��
���k�"����4���s�AC�
AC�=C�-D�?Dc��|dk(r�t�td�td�g}t�D]L\}}}}dj|�dz||xrddj|�zdzxsdf}|j|��N|j	�|D]}td	j
|���y|d
k(r�t�td�td�g}t
�D]p}t|�}	dj|j�dz|	|jxr!ddj|j�zdzxsdf}|j|��r|j	�|D]}td	j
|���y|d
k(rct�td�td�t�D]5}
t|
�}td|
zdz�tdt|�����7y|dk(rct�td�td�t�D]5}
t|
�}td|
zdz�tdt|�����7yy)Nr=zLexers:z~~~~~~~z, r3z(filenames �)�z* {}
    {} {}r>zFormatters:z~~~~~~~~~~~r?zFilters:z~~~~~~~~z* z    �stylezStyles:)rBr
�joinr4�sort�formatrr�aliases�	filenamesrrr r!)rH�info�fullname�names�exts�_�tup�irI�docrCs           r0�_print_listr\Ws*���w��
��
�i��
�i����(6�(8�$�H�e�T�1��9�9�U�#�C�'���A�M�D�I�I�d�O�;�c�A�G�R�I�C��K�K���)9�	
�	�	���A��,�$�,�,�a�0�1��
��	�
��
�m��
�m����%�'�C�$�S�)�C��9�9�S�[�[�)�C�/��c�m�m�7B� �4�9�9�S�]�]�#;�;�c�A�7H�EG�I�C��K�K���	(�
	
�	�	���A��,�$�,�,�a�0�1��
��	�
��
�j��
�j��#�%�D�#�D�)�C��$��+��#�$��D�+�C�0�1�2�3�&�

���
��
�i��
�i��"�$�D�#�D�)�C��$��+��#�$��D�+�C�0�1�2�3�%�
r;c��ddl}i}d|vr$i}t�D]\}}}}|||d�||<�||d<d|vrHi}t�D]4}t|�}	|j|j
|	d�||j<�6||d<d|vr1i}t�D]}
t|
�}d	t|�i||
<�||d
<d|vr1i}t�D]}
t|
�}d	t|�i||
<�||d<|j|tj�y)
Nrr=)rRrS�	mimetypes�lexersr>)rRrSr[�
formattersr?r[r6rN�styles)�jsonr
rrrRrSrCrrr r!�dumprF�stdout)�requested_itemsrb�resultrTrUrVrSr^rIr[rCs           r0�_print_list_as_jsonrg�s<���
�F��/�!���5C�5E�1�H�e�Y�	� �&�&��D��N�6F� ��x���o�%���%�'�C�$�S�)�C��;�;� �]�]���D����N�(� $��|���?�"���#�%�D�#�D�)�C��)�#�.��D��J�&�
!��y���/�!���"�$�D�#�D�)�C��)�#�.��D��J�%�
 ��x���I�I�f�c�j�j�!r;c����&��jr|j�y�jrtdt�d��y�fd�}�j
��+t
�}t��j�D]\}}|s�	|j|��|jd�|jd�|r |jtj�y�js
tdd	g�hd
��&�j
D�cgc]}|jd���}}t!�&fd�|D��r |jtj�y|s�&}�js|D]
}t#|��yt%|�y�j&rg|d
�s |jtj�y�j&\}}	|dvr |jtj�yt)||	�St+�j,xsg�}
�j.xsgD]}	|j1dd�\}	}||
|	<�|
j5d|
j5d��}
|
j5d|
j5d��}�j6r6t9�j6�}|�t:}t|j<d�y�j>rOtj@jBjE�}	tG||
��}t|j<d�y�jJ}�jL}|���jN}|s |jtj�y�jPs�jRr |jtj�y	||
d<tU|fi|
��}t|jW|xsd��y�jL� |jtj�ytY�jZxsg�}t]�j^�}d}�jP}|rV|rGd|vrC	d}d}	d|vr|jadd�\}}	d|	vrd}	|r|	rtc||	fi|
��}ntc|fi|
��}n
	te|fi|
��}d}�jRr{�jhrtdtj��y�jR}	tk|d�5}|jE�}ddd�|
sto|�\}}
|s�	tq||fi|
��}n��jhsWtj@jBjE�}|
stu|tj@�\}}
|s,	tG|fi|
��}n|stdtj��y|D]\}}	|jv|fi|����jx}�jN}|rV|rGd|vrC	d}d}	d|vr|jadd�\}}	d|	vrd}	|r|	rt{||	fi|
��}nt{|fi|
��}n
	tU|fi|
��}|r|s
	t}|fi|
��}	tk|d�} n�|sgt~j�j5d!d�d"vrt�d,i|
��}n9d#t~j�j5d$d�vrt�d,i|
��}nt�d,i|
��}tj�jB} |s(|r|
|_Ent�tj��|_E|sctj�d%vrQ|j�d&vrCt�| |j��'�} d|_E	ddlJ}!|!j�j�| ddd(d�)�} |
j5d*d�}"t�|"�dk(r't�|t��r|"d}#|"d}$t�|#|$|�}�jhs"	t�|||| �|r| j��y		tj@jBj��}%|%snJ|
stu|%tj@�d}%t�|%||| �t�| d+�r| j���u	|r| j��yycc}w#t2$r	d|
|<Y��PwxYw#tH$r
t:}Y���wxYw#tH$r%}t|tj��Yd}~yd}~wwxYw#tH$r&}td|tj��Yd}~yd}~wwxYw#tftHf$r&}td|tj��Yd}~yd}~wwxYw#1swY��7xYw#tl$r&}td|tj��Yd}~yd}~wwxYw#tH$r`}�jrr(	tG|fi|
��}n;#tH$rt;d,i|
��}Yn%wxYwtd|tj��Yd}~yYd}~��.d}~wtf$r&}td|tj��Yd}~yd}~wwxYw#tH$rt;d,i|
��}Y��zwxYw#tH$r'}td|tj��Yd}~yd}~wwxYw#tH$r&}td|tj��Yd}~yd}~wwxYw#tftHf$r&}td|tj��Yd}~yd}~wwxYw#tftHf$r&}td|tj��Yd}~yd}~wwxYw#tl$r&}td |tj��Yd}~yd}~wwxYw#t�$rY���wxYw#|r| j��wwxYw#t�$rY|r| j��yywxYw#|r| j��wwxYw)-NrzPygments version uD, (c) 2006-2024 by Georg Brandl, Matthäus Chajdas and contributors.c�^���t�fd�t��j�D��S)Nc3�4�K�|]\}}|�k7s�|���y�w�N�)�.0�k�v�opts   �r0�	<genexpr>z5main_inner.<locals>.is_only_option.<locals>.<genexpr>�s�����G�':�V�a��a�3�h�q�':�s�
�)�any�vars�items)rp�argnss`�r0�is_only_optionz"main_inner.<locals>.is_only_option�s$����G�t�E�{�'8�'8�':�G�G�G�Gr;�Lrb�rM�-V>r=rNr?r>�sc3�&�K�|]}|�v���
y�wrkrl)rm�arg�
allowed_typess  �r0rqzmain_inner.<locals>.<genexpr>�s�����9�5�C�s�-�'�5�s��H)r=r>r?r$r%T�
inencoding�encoding�outencoding)rrNr@z.pyr3zError: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)�Terminal�Terminal256)r�F)�convertr&�	autoreset�wrap�escapeinside�flushrl)X�help�
print_help�VrBrrw�setrsrt�add�discardrFrGrb�main�rstriprrr\rgr~rJr1�O�Pr'r(�get�NrrrR�C�stdin�buffer�readrr�S�a�f�l�	INPUTFILEr�get_style_defsr:�F�bool�x�rsplitrrrrz�open�	Exceptionr	r�gr
�
add_filter�orr�os�environrrrrdr�r�platformrCr�colorama.initialise�
initialise�wrap_stream�ImportError�len�
isinstancerrr�close�readline�hasattrr��KeyboardInterrupt)'�parserrurv�arg_setrnror|�largsrHrC�parsed_opts�p_opt�valuerr�r=�inp�S_opt�a_opt�f_opt�fmter�err�F_opts�allow_custom_lexer_formatter�	lexername�filename�code�infn�infpr8r9�outfn�outfile�coloramar��left�right�liner}s' `                                    @r0�
main_innerr��s^
����z�z�������w�w�
�!�+��/*�*�	+��H�
�w�w���%����K�%�%�'�D�A�q�����A��(�	��������������c�j�j�)���z�z��"�d���A�
�,1�G�G�4�G�S����C��G��4��9�5�9�9����c�j�j�)���!�E��z�z����C� ���
 ��&��
�w�w��c�"����c�j�j�)���W�W�
��d��7�7����c�j�j�)���4��&�&�!�����B�/�K�����B���	&��+�+�c�1�-�K�D�%�!&�K���
�����{���z�/J�K�J��/�/�-�����1L�M�K�
�w�w�-�e�g�g�6���=��E�
�e�m�m�A����
�w�w��i�i���#�#�%��	���
�;�E�	�e�m�m�A����
�G�G�E��G�G�E�����������c�j�j�)���7�7�e�o�o����c�j�j�)��	�#(�K�� �)�%�?�;�?�E�
	�e�"�"�5�;�B�/�0��
�w�w�����#�*�*�%���E�G�G�M�r�
*�F�$(����=� �
�E����I��'�E�Y�,>�
������)�#�%.�%5�%5�c�1�%=�N�H�d���}� $����0��4�@�3>�@�E�1��J�k�J�E��

�)�)�C�{�C���D�����7�7��I��z�z�
#������	��d�D�!�T��y�y�{��"�
�+�D�1��D�*��

�.�t�T�I�[�I���W�W��y�y���$�$�&���9�$��	�	�J��D�*��
1�#�D�8�K�8��
��K��z�z�
#�����u�	��E���U�,�e�,��
�G�G�E��G�G�E��'�E�U�N�
������%�<�%*�\�\�#�q�%9�N�H�d���}�#����4�X�t�D�7B�D�E�5�U�J�k�J�E��

�-�e�C�{�C��

��
�2�5�H�K�H��	��5�$�'�G�
��z�z�~�~�k�"�-�1G�G�2�A�[�A���"�*�*�.�.���4�4�,�;�{�;��)�8�K�8���*�*�#�#����'�E�N�/�s�z�z�:�E�N��S�\�\�%8�8��z�z�0�0�(��5�>�>�J�����	O�&��)�)�5�5���T�U��6�O�G��?�?�>�2�6�L�
�<��A��*�U�N�"C��A����Q���"�4���6���7�7�	 ��d�E�5�'�2���
�
���	 ���y�y�'�'�0�0�2����!�5�d�C�I�I�F�q�I�D��$��u�g�6��7�G�,��M�M�O�����
�
����Y	5��>�	&�!%�K���	&��.�	��E�	��*�	��#�C�J�J�'���	��T!�
��h��#�*�*�5���
�� ��/�
��h��#�*�*�5���
��"�!���	��.��#�*�*�E���	��!�
��7�7�9� +�D� @�K� @���(�9� )� 8�K� 8��9���(�C�c�j�j�9�����
��h��#�*�*�5���
��!�
1�!�0�K�0��
1���	��(�C�c�j�j�1���	��2!�
��h��#�*�*�5���
�� ��/�
��h��#�*�*�5���
�� ��/�
��h��#�*�*�5���
��
�	��/��3�:�:�F���	��<�	��	��*��
�
���� !�	����
�
���	����
�
���s��a�a�2
a-�b�:Ab4�=c&�d+�d�)d+�
e�(g6�h�Ai�i6�&j.�3k&�.l�&l(�A6m�a*�)a*�-b�?b�	b1�b,�,b1�4	c#�=c�c#�&d�5d�d�d(�#d+�+	e�4e�e�	g3�&g�3f�?g�f�g�f�g�g3�
g.�.g3�6h�
h�	i�h<�<i�	i3�
i.�.i3�6j+�j&�&j+�.k#�=k�k#�&	l�/l�l�	l%�$l%�(l=�	m�	m"�m�m"�"m7c��eZdZdd�Zy)�
HelpFormatterNc��|�"	tj�jdz
}tj
j
|||||�y#t$rY�/wxYw)Nrx)�shutil�get_terminal_size�columnsr��argparser��__init__)�self�prog�indent_increment�max_help_position�widths     r0r�zHelpFormatter.__init__s\���=�
��0�0�2�:�:�Q�>��	���'�'��d�4D�(9�5�	B���
��
�s�!A	�		A�A)rx�N)�__name__�
__module__�__qualname__r�rlr;r0r�r�s��Br;r�c���d}tj|dt��}|jd�}|j	�}|jddd��|jd	d
d��|jd
ddd��|jddd��|jdddd��|jdddd��|jddd��|jddd �!�|jd"�}|jd#d
d$��|jd%d
d&��|jd'd
d(��|jd)d*dd
�+�|jd,�}|j	�}|jd-d.d/��|jd0d1d2d3�4�|jd5d6d7��|jd8d
d9��|jd:d;d<d=d>�?�|jd@d
dA��|jdBdCd
dD��|jdEdFdG��|j
|dHdI�}	t||�S#t$rYyJt$�r�|jr�ttj�K�tdLtj�K�tdMtj�K�tdNtj�K�tdOtj�K�tdLtj�K�ttj�K��dJdIl}	|	jtj ��}
|
dPj#�}t%|
�dQk\r:|dRj'|
dSj)dT�dJj#�dHdI�z
}ttj�K�tdUtj�K�t|tj�K�tdVtj�K�YyHwxYw)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]r4znAdd 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�storerx)�NAME�TYPEzrPrint detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".)r�r�r�r�ryzPrint the package version.z-hz--helpzPrint this help.z-a�ARGzKFormatter-specific additional argument for the -S (print style sheet) mode.r%Nrr@zA*****************************************************************z3An unhandled exception occurred while highlighting.z9Please report the whole traceback to the issue tracker atz.<https://github.com/pygments/pygments/issues>.����z	
   (f{})����
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�rorBrFrG�	traceback�format_exception�exc_infor&r�rQr')�args�descr��	operation�lexersel�flags�special_modes_group�
special_modesrurrT�msgs            r0r�r�s[��M�D�
�
$�
$���5B�D�F��)�)�*:�;�I��5�5�7�H�����g�O��P�
����\�3��4�����(��?��@�����k�1��2�����7��.��/�
����n�X�D��E�
����l�
G��I�����3�
D��F�
�%�%�&7�8�E�	����\�3��4�
����\�C��D�
����\�6��7�
���x�'/�����
!�3�3�4�6��'�D�D�F�M�����*����
����C��<��=�
����j�6��7�
����\�/��0�����W�A�/?�C��D�����\�
)��+�����h�|�
��!��$�$��e��%��

���d�1�2�h�'�E���&�%�(�(��������7�7��s�z�z�"��(����,��G��z�z�
#��M��z�z�
#��B��z�z�
#��(����,��s�z�z�"���)�y�)�)�3�<�<�>�:���2�h�n�n����t�9��>��<�&�&�t�B�x�~�~�d�';�A�'>�'D�'D�'F�q�r�'J�K�K�C�
�3�:�:��
�-�C�J�J�?�
�c��
�
�#�
�N��:�:�	��1�s�H+�+	O5�6F<O5�4O5)8rDr�rFr�r��textwrapr�pip._vendor.pygmentsrr�pip._vendor.pygments.utilrrrr	r
rr�pip._vendor.pygments.lexersr
rrrrr�#pip._vendor.pygments.lexers.specialr�%pip._vendor.pygments.formatters.latexrr�pip._vendor.pygments.formattersrrrrr�(pip._vendor.pygments.formatters.terminalr�+pip._vendor.pygments.formatters.terminal256rr�pip._vendor.pygments.filtersrr�pip._vendor.pygments.stylesr r!r1r:rJr\rgr�r��argvr�rlr;r0�<module>rs����
�
�
���7����P�P�9�T�O�O�F�h�K�I��*
��(04�f*"�XL �^
B�H�*�*�B��h�h�Lr;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists