Your IP : 13.58.61.176


Current Path : /opt/alt/python311/lib64/python3.11/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/distutils/__pycache__/fancy_getopt.cpython-311.opt-2.pyc

�

c��fxE�	��	ddlZddlZddlZddlZddlTdZejdez��Zejde�de�d���Ze	�
dd	��ZGd
�d��Zd�Z
d
�ejD��Zd�Zd�ZGd�d��ZedkrGdZdD]DZedez��ed�eee������e���CdSdS)�N)�*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(z)=!(z)$�-�_c�n�eZdZ	dd�Zd�Zd�Zdd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zdd�Z
d
�Zdd�Zdd�ZdS)�FancyGetoptNc���||_i|_|jr|���i|_i|_g|_g|_i|_i|_i|_	g|_
dS�N)�option_table�option_index�_build_index�alias�negative_alias�
short_opts�	long_opts�
short2long�	attr_name�	takes_arg�option_order��selfr
s  �=/opt/alt/python311/lib64/python3.11/distutils/fancy_getopt.py�__init__zFancyGetopt.__init__)s{��)��������	 ���������
�!������������������
�����c�l�|j���|jD]}||j|d<�dS)Nr)r�clearr
)r�options  rrzFancyGetopt._build_indexQsG������!�!�!��'�	2�	2�F�+1�D��f�Q�i�(�(�	2�	2rc�<�||_|���dSr	)r
rrs  r�set_option_tablezFancyGetopt.set_option_tableVs"��(����������rc��||jvrtd|z���|||f}|j�|��||j|<dS)Nz'option conflict: already an option '%s')r�DistutilsGetoptErrorr
�append)r�long_option�short_option�help_stringrs     r�
add_optionzFancyGetopt.add_optionZse���$�+�+�+�&�;�k�I�K�K�
K�"�<��=�F���$�$�V�,�,�,�-3�D��k�*�*�*rc��	||jvSr	)r�rr"s  r�
has_optionzFancyGetopt.has_optioncs��	0��d�/�/�/rc�8�	|�t��Sr	��	translate�
longopt_xlater's  r�
get_attr_namezFancyGetopt.get_attr_namehs��	��$�$�]�3�3�3rc
���|���D]I\}}||jvrtd|�d|�d|�d����||jvrtd|�d|�d|�d�����JdS)Nzinvalid z 'z': option 'z
' not defined�': aliased option ')�itemsrr )r�aliases�whatr
�opts     r�_check_alias_dictzFancyGetopt._check_alias_dictns���#�M�M�O�O�	P�	P�L�U�C��D�-�-�-�*�*�59�T�T�5�5�5�%�%�%�,I�J�J�J��$�+�+�+�*�*�=A�T�T�5�5�5�#�#�#�,O�P�P�P�,�		P�	Prc�B�	|�|d��||_dS)Nr
)r4r
)rr
s  r�set_aliaseszFancyGetopt.set_aliasesxs&��5����u�g�.�.�.���
�
�
rc�B�	|�|d��||_dS)Nznegative alias)r4r)rrs  r�set_negative_aliasesz FancyGetopt.set_negative_aliases}s.��	 �	
���~�/?�@�@�@�,����rc��	g|_g|_|j���i|_|jD�]$}t
|��dkr	|\}}}d}n-t
|��dkr|\}}}}ntd|�����t|t��rt
|��dkrtd|z���|�:t|t��rt
|��dkstd|z���||j|<|j�|��|d	d
kr|r|dz}|dd	�}d|j|<nS|j
�|��}|�-|j|rtd|�d
|�d����||jd	<d|j|<|j�|��}|�2|j||j|krtd|�d|�d����t �|��std|z���|�|��|j|<|r*|j�|��||j|d<��&dS)N�r�zinvalid option tuple: �z9invalid long option '%s': must be a string of length >= 2�z:invalid short option '%s': must a single character or None����=�:zinvalid negative alias 'r/z' takes a valuezinvalid alias 'z%': inconsistent with aliased option 'z/' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)rrrr�repeatr
�len�
ValueError�
isinstance�strr r!rr�getr
�
longopt_re�matchr-r)rr�long�short�helprA�alias_tos       r�_grok_option_tablezFancyGetopt._grok_option_table�s���	������������������'�A	1�A	1�F��6�{�{�a���$*�!��e�T�����V����!�!�,2�)��e�T�6�6�!�j�v�v�!G�H�H�H��d�C�(�(�
B�C��I�I��M�M�*�-9�<@�,A�B�B�B��m� ���,�,�$�14�U���q���*�,9�;@�,A�B�B�B�!'�D�K����N�!�!�$�'�'�'��B�x�3����-�%�#�+�%��A�b�D�z��'(���t�$�$� �.�2�2�4�8�8���'��~�h�/�2�2�2�"&���x�x�x�1�2�2�2�
*.�D�N�2�&�'(���t�$��z�~�~�d�+�+�H��#��>�$�'�4�>�(�+C�C�C�.�.�"�T�T�8�8�8�-�.�.�.��#�#�D�)�)�
I�*�A�CG�H�I�I�I�$(�#5�#5�d�#;�#;�D�N�4� ��
1���&�&�u�-�-�-�,0����a��)��CA	1�A	1rc�L�	|�tjdd�}|�t��}d}nd}|���d�|j��}	t
j|||j��\}}n&#tj$r}t|���d}~wwxYw|D]�\}}t|��dkr |ddkr|j|d}n
|dd�}|j�
|��}	|	r|	}|j|s#|j�
|��}	|	r|	}d}nd}|j|}
|r.|j�
|
���t%||
d��dz}t'||
|��|j�||f����|r||fS|S)Nr=TF� r<rr)�sys�argv�OptionDummyrM�joinr�getoptr�error�DistutilsArgErrorrBrr
rFrrrrA�getattr�setattrrr!)r�args�object�created_objectr�opts�msgr3�valr
�attrs           rrTzFancyGetopt.getopt�s���		��<��8�A�B�B�<�D��>� �]�]�F�!�N�N�"�N����!�!�!��X�X�d�o�.�.�
�	)���t�Z���H�H�J�D�$�$���|�	)�	)�	)�#�C�(�(�(�����	)�����	1�	1�H�C���3�x�x�1�}�}��Q��3����o�c�!�f�-����!�"�"�g���J�N�N�3�'�'�E��
����>�#�&�
��+�/�/��4�4�����C��C�C��C��>�#�&�D��
3�t�{���t�,�,�8��f�d�A�.�.��2���F�D�#�&�&�&���$�$�c�3�Z�0�0�0�0��	���<���Ks�A;�;B�
B�Bc�>�	|j�td���|jS)Nz!'getopt()' hasn't been called yet)r�RuntimeError)rs r�get_option_orderzFancyGetopt.get_option_orders*��	���$��B�C�C�C��$�$rc��	d}|jD]A}|d}|d}t|��}|ddkr|dz
}|�|dz}||kr|}�B|dzdzdz}d}||z
}	d|z}
|r|g}nd	g}|jD]�}|dd
�\}}}t||	��}
|ddkr
|dd�}|�?|
r"|�d|||
dfz��n_|�d||fz��nD|�d
|�d�}|
r"|�d|||
dfz��n|�d|z��|
dd�D]}|�|
|z�����|S)Nrr=r>r?�r<�NrOzOption summary:r:z  --%-*s  %sz
  --%-*s  z (-�)z  --%-*s)r
rB�	wrap_textr!)r�header�max_optrrIrJ�l�	opt_width�
line_width�
text_width�
big_indent�linesrK�text�	opt_namess               r�
generate_helpzFancyGetopt.generate_helps���	����'�		�		�F��!�9�D��1�I�E��D�	�	�A��B�x�3�����E��� ���E���7�{�{�����a�K�!�O�a�'�	�0�
��)�+�
��9�_�
��	(��H�E�E�&�'�E��'�	-�	-�F� &�r��r�
��D�%���T�:�.�.�D��B�x�3����A�b�D�z���}��A��L�L��7�D�$�q�'�2J�!J�K�K�K�K��L�L���$��!?�@�@�@�@�
+/�$�$����6�	��9��L�L��")�9�d�1�g�!>�"?�@�@�@�@��L�L��i�!7�8�8�8��!�"�"�X�
-�
-�����Z�!�^�,�,�,�,�
-��rc��|�tj}|�|��D]}|�|dz���dS)N�
)rP�stdoutrr�write)rrh�file�lines    r�
print_helpzFancyGetopt.print_helphsN���<��:�D��&�&�v�.�.�	$�	$�D��J�J�t�d�{�#�#�#�#�	$�	$rr	)NN)�__name__�
__module__�__qualname__rrrr%r(r-r4r6r8rMrTrbrrry�rrrrs������	�&�&�&�&�P2�2�2�
���4�4�4�4�0�0�0�
4�4�4�P�P�P����
-�-�-�K1�K1�K1�Z;�;�;�;�z%�%�%�M�M�M�M�^$�$�$�$�$�$rrc�v�t|��}|�|��|�||��Sr	)rr8rT)�options�negative_optrZrY�parsers     r�fancy_getoptr�os7��
��
!�
!�F�
����-�-�-��=�=��v�&�&�&rc�.�i|]}t|��d��S)rO)�ord)�.0�_wschars  r�
<dictcomp>r�us ��@�@�@�7�C��L�L�3�@�@�@rc��	|�gSt|��|kr|gS|���}|�t��}t	jd|��}d�|D��}g}|r�g}d}|r\t|d��}||z|kr$|�|d��|d=||z}n|r|dddkr|d=n|�\|rQ|dkr6|�|dd|���|d|d�|d<|dddkr|d=|�d�|����|��|S)Nz( +|-+)c��g|]}|�|��Sr}r})r��chs  r�
<listcomp>zwrap_text.<locals>.<listcomp>�s��
(�
(�
(�R�R�
(�b�
(�
(�
(rrr>rO�)rB�
expandtabsr+�WS_TRANS�re�splitr!rS)rp�width�chunksro�cur_line�cur_lenrjs       rrgrgws����
�|��	�
�4�y�y�E����v�
��?�?���D��>�>�(�#�#�D�
�X�j�$�
'�
'�F�
(�
(�6�
(�
(�
(�F��E�
� (������
	��F�1�I���A���{�e�#�#�����q�	�*�*�*��1�I�!�A�+����%����Q��3� 6� 6� �����
	��	��!�|�|�����q�	�!�E�'� 2�3�3�3�"�1�I�e�f�f�-��q�	�
�a�y��|�s�"�"��1�I�	���R�W�W�X�&�&�'�'�'�A� (�D�Lrc�8�	|�t��Sr	r*)r3s r�translate_longoptr��s����=�=��'�'�'rc��eZdZ	gfd�ZdS)rRc�4�	|D]}t||d���dSr	)rX)rrr3s   rrzOptionDummy.__init__�s5��	2��	%�	%�C��D�#�t�$�$�$�$�	%�	%rN)rzr{r|rr}rrrRrR�s2������&� "�%�%�%�%�%�%rrR�__main__z�Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))�
���(z	width: %drt)rP�stringr�rT�distutils.errors�longopt_pat�compilerG�neg_alias_rerE�	maketransr,rr��
whitespacer�rgr�rRrzrp�w�printrSr}rr�<module>r�s����������������
�
�
�
�����+��
�R�Z��+�-�
.�
.�
��r�z�z�K�K�K����E�F�F���
�
�c�3�'�'�
�O$�O$�O$�O$�O$�O$�O$�O$�d
'�'�'�A�@�f�.?�@�@�@��3�3�3�l(�(�(�%�%�%�%�%�%�%�%��z��� �D�����
��k�A�o����
��d�i�i�	�	�$��*�*�+�+�,�,�,�
���������r

?>