%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/pygments/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/pygments/__pycache__/cmdline.cpython-312.pyc

�

|�e�[��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-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�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       �2/usr/lib/python3/dist-packages/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:6sh���G�����(���%�<� �;�;�s�A�.�L�E�5��N�N�E�>�5�'�#:�;�<��N�N�E�2�;�'�(��N�c��	|dk(rBt|�}td|jz�tt|j��y|dk(rBt|�}td|jz�tt|j��y|dk(r7t
|�}td|z�tt|j��y#ttf$r!td|ztj�	�Yy
wxYw)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)�whatrC�clss   r0�_print_helprJCs�����7�?�#�D�)�C��)�C�H�H�4�5��&����%�&���[�
 �&�t�,�C��-����8�9��&����%�&�
�	�X�
�#�D�)�C��*�T�1�2��&����%�&����J�'��
�o��$�3�:�:�6���s�AC
�	AC
�<C
�
-C=�<C=c��|dk(r�t�td�td�g}t�D]L\}}}}dj|�dz||xrddj|�zdzxsdf}|j|��N|j	�|D]}td	|z��y|d
k(r�t�td�td�g}t�D]p}t
|�}	dj|j�dz|	|jxr!ddj|j�zdzxsdf}|j|��r|j	�|D]}td	|z��y|d
k(rct�td�td�t�D]5}
t|
�}td|
zdz�tdt
|�z��7y|dk(rct�td�td�t�D]5}
t|
�}td|
zdz�tdt
|�z��7yy)Nr=zLexers:z~~~~~~~z, r3z(filenames �)�z* %s
    %s %sr>zFormatters:z~~~~~~~~~~~r?zFilters:z~~~~~~~~z* z    %s�stylezStyles:)
rBr
�joinr4�sortrr�aliases�	filenamesrrr r!)rH�info�fullname�names�exts�_�tup�irI�docrCs           r0�_print_listr[Ws0���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���	�	
�	�	���	+�A��$��)�*�	+�
��	�
��
�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��$��)�*�	+�
��	�
��
�j��
�j��#�%�	6�D�#�D�)�C��$��+��#�$��(�/��4�4�5�	6�

���
��
�i��
�i��"�$�	6�D�#�D�)�C��$��+��#�$��(�/��4�4�5�	6�
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=)rQrR�	mimetypes�lexersr>)rQrRrZ�
formattersr?rZr6rN�styles)�jsonr
rrrQrRrCrrr r!�dumprF�stdout)�requested_itemsra�resultrSrTrUrRr]rIrZrCs           r0�_print_list_as_jsonrf�sO���
�F��/�!���5C�5E�	�1�H�e�Y�	� �&�&��D��N�	� ��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�jrtdtz�y�fd�}�j
��+t
�}t��j�D]\}}|s�	|j|��|jd�|jd�|r |jtj�y�js
tddg�hd	��&�j
D�cgc]}|jd
���}}t!�&fd�|D��r |jtj�y|s�&}�js|D]
}t#|��yt%|�y�j&rg|d�s |jtj�y�j&\}}	|d
vr |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),NruWPygments version %s, (c) 2006-2023 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�G�s�
�)�any�vars�items)ro�argnss`�r0�is_only_optionz"main_inner.<locals>.is_only_option�s$����G�t�E�{�'8�'8�':�G�G�G�Gr;�Lra�rM�-V>r=rNr?r>�sc3�&�K�|]}|�v���
y�wrjrk)rl�arg�
allowed_typess  �r0rpzmain_inner.<locals>.<genexpr>�s�����9�C�s�-�'�9�s��H)r=r>r?r$r%T�
inencoding�encoding�outencoding)r~rNr@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)rF)�convertr&�	autoreset�wrap�escapeinside�flushrk)X�help�
print_help�VrBrrv�setrrrs�add�discardrFrGra�main�rstriprqr[rfr}rJr1�O�Pr'r(�get�NrrrQ�C�stdin�buffer�readrr�S�a�f�l�	INPUTFILEr�get_style_defsr:�F�bool�x�rsplitrrrry�open�	Exceptionr	r�gr
�
add_filter�orr�os�environrrrrcrr�platformrCr�colorama.initialise�
initialise�wrap_stream�ImportError�len�
isinstancerrr�close�readline�hasattrr��KeyboardInterrupt)'�parserrtru�arg_setrmrnr{�largsrHrC�parsed_opts�p_opt�valuer~r�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��sr
����z�z�������w�w�
�*�,7�8�	9��H�
�w�w���%����K�%�%�'�	�D�A�q�����A��	�	��������������c�j�j�)���z�z��"�d���A�
�,1�G�G�4�S����C��4��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�1
a,�b�9Ab3�<c%�d*�d�(d*�
e�'g5�h�Ai�i5�%j-�2k%�-l�%l'�A6l?�a)�(a)�,a?�>a?�	b0�b+�+b0�3	c"�<c�c"�%d�4d�d�d'�"d*�*	e�3e�e�	g2�%g�2e?�>g�?f�g�f�g�g2�g-�-g2�5h
�h
�	i�h;�;i�	i2�i-�-i2�5j*�j%�%j*�-k"�<k�k"�%	l�.l�l�	l$�#l$�'l<�?	m�m!�m�m!�!m6c��eZdZdd�Zy)�
HelpFormatterNc��|�"	tj�jdz
}tj
j
|||||�y#t$rY�/wxYw)Nrw)�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)rw�N)�__name__�
__module__�__qualname__r�rkr;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.|dR|
dSj'dT�dJj#�dHdIzz
}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�storerw)�NAME�TYPEzrPrint detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".)r�r�r�r�rxzPrint 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%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�rnrBrFrG�	traceback�format_exception�exc_infor&r�r')�args�descr��	operation�lexersel�flags�special_modes_group�
special_modesrtrrS�msgs            r0r�r�sU��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��>��<�$�r�(�.�.��"6�q�"9�"?�"?�"A�!�"�"E�E�E�C�
�3�:�:��
�-�C�J�J�?�
�c��
�
�#�
�N��:�:�	��1�s�H+�+	O)�6F0O)�(O))8rDr�rFr�r��textwrapr�pygmentsrr�
pygments.utilrrrr	r
rr�pygments.lexersr
rrrrr�pygments.lexers.specialr�pygments.formatters.latexrr�pygments.formattersrrrrr�pygments.formatters.terminalr�pygments.formatters.terminal256rr�pygments.filtersrr�pygments.stylesr r!r1r:rJr[rfr�r��argvr�rkr;r0�<module>rs����
�
�
���+����P�P�-�H�O�O�:�\�?�=��*
��(06�f*"�XL �^
B�H�*�*�B��h�h�Lr;

Zerion Mini Shell 1.0