Your IP : 3.135.206.19


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/optparse.cpython-312.opt-2.pyc

�

�Q�f�����	dZgd�ZdZddlZddlZddlZd�Z	ddlmZmZeZ
Gd	�d
e�ZGd�de�Z
Gd
�de
�ZGd�de�ZGd�de�ZGd�de�ZGd�d�ZGd�de�ZGd�de�Zd�Zd�Zee
d�fee
d�fee
d�fee
d�fd �Zd!�Zd"�Zd#ZGd$�d%�Zd&Zd'ZGd(�d)�Z Gd*�d+�Z!Gd,�d-e!�Z"Gd.�d/e!�Z#d0�Z$eZ%y#e	$r	d�Zd�ZY��wxYw)1z1.5.3)�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�Nc�L�d|jjt|�|fzS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��selfs �//opt/alt/python312/lib64/python3.12/optparse.py�_reprrOs"������!8�!8�"�T�(�D� I�I�I�)�gettext�ngettextc��|S�N�)�messages rrr\s���rc��|dk(r|S|S�N�r!)�singular�plural�ns   rrr_s����6��O��
rc��eZdZd�Zd�Zy)r
c��||_yr ��msg�rr,s  r�__init__zOptParseError.__init__hs	����rc��|jSr r+rs r�__str__zOptParseError.__str__ks���x�x�rN�r�
__module__�__qualname__r.r0r!rrr
r
gs���rr
c��eZdZ	d�Zd�Zy)rc�2�||_t|�|_yr )r,�str�	option_id)rr,�options   rr.zOptionError.__init__us������V���rc�j�|jrd|j�d|j��S|jS)Nzoption z: )r7r,rs rr0zOptionError.__str__ys%���>�>�&*�n�n�d�h�h�?�?��8�8�OrNr1r!rrrros���
%�rrc��eZdZy)rN�rr2r3r!rrrrs��rrc��eZdZy)rNr;r!rrrr�s��rrc��eZdZ	d�Zd�Zy)rc��||_yr )�opt_str�rr?s  rr.zBadOptionError.__init__�s	����rc�2�td�|jzS)Nzno such option: %s)�_r?rs rr0zBadOptionError.__str__�s���%�&����5�5rNr1r!rrrr�s����6rrc��eZdZ	d�Zd�Zy)�AmbiguousOptionErrorc�>�tj||�||_yr )rr.�
possibilities)rr?rFs   rr.zAmbiguousOptionError.__init__�s������g�.�*��rc�h�td�|jdj|j�fzS)Nzambiguous option: %s (%s?)�, )rBr?�joinrFrs rr0zAmbiguousOptionError.__str__�s2���.�/��<�<����4�+=�+=�!>�?�@�	ArNr1r!rrrDrD�s���+�ArrDc�l�eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zy)r
�nonec�d�d|_||_|�"	ttjd�}|dz}||_t|t|dz
|dz��x|_
|_d|_d|_
d|_||_d|_i|_d|_d|_y#t
tf$rd}Y��wxYw)	N�COLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rrRr\rXr`s     rr.zHelpFormatter.__init__�s���
��� 0����=�
��B�J�J�y�1�2��
�Q�J�E���
��%�s�5�2�:�7G�!�7K�'L�M�	N���T�3������
����&���%��� ���%���$�����j�)�
���
�s�B�B/�.B/c��||_yr )rQ�rrQs  r�
set_parserzHelpFormatter.set_parser�s	����rc�B�|dvrtd|z��d|zdz|_y)N)�� z/invalid metavar delimiter for short options: %r�%s)rWrc�r�delims  r�set_short_opt_delimiterz%HelpFormatter.set_short_opt_delimiter�s2���	�!��A�E�I�K�
K�"�U�l�T�1��rc�B�|dvrtd|z��d|zdz|_y)N)�=rkz.invalid metavar delimiter for long options: %rrl)rWrdrms  r�set_long_opt_delimiterz$HelpFormatter.set_long_opt_delimiter�s2���
�"��@�5�H�J�
J�!�E�\�D�0��rc�l�|xj|jz
c_|xjdz
c_yr$�r]rRr^rs r�indentzHelpFormatter.indent�s&�����t�4�4�4���
�
�a��
rc�l�|xj|jzc_|xjdzc_yr$rtrs r�dedentzHelpFormatter.dedent�s&�����t�4�4�4���
�
�a��
rc��td���Nzsubclasses must implement��NotImplementedError�r�usages  r�format_usagezHelpFormatter.format_usage����!�"=�>�>rc��td��ryrz�r�headings  r�format_headingzHelpFormatter.format_headingrrc��	t|j|jz
d�}d|jz}tj||||��S)N�rk)�initial_indent�subsequent_indent)rZrXr]�textwrap�fill)r�text�
text_widthrus    r�_format_textzHelpFormatter._format_textsP��	�����d�&9�&9�9�2�>�
��T�(�(�(���}�}�T�'�,2�/5�7�	7rc�0�|r|j|�dzSy�N�
rj�r��r�descriptions  r�format_descriptionz HelpFormatter.format_descriptions����$�$�[�1�D�8�8�rc�6�|rd|j|�zdzSyr�r�)r�epilogs  r�
format_epilogzHelpFormatter.format_epilogs#����$�+�+�F�3�3�d�:�:�rc�2�|j�|js|jS|jjj	|j
�}|tus|�|j}|jj|jt|��Sr )
rQra�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer6)rr8�
default_values   r�expand_defaultzHelpFormatter.expand_defaultsv���;�;��d�&6�&6��;�;�����,�,�0�0����=�
��J�&�-�*?� �1�1�M��{�{�"�"�4�#3�#3�S��5G�H�Hrc	�t�g}|j|}|j|jz
dz
}t|�|kDrd|jd|fz}|j}nd|jd||fz}d}|j	|�|j
r~|j
|�}tj||j�}|j	d|d|dfz�|j|ddD�cgc]}d|jd|fz��c}�n|ddk7r|j	d�dj|�Scc}w)	NrOz%*s%s
rjz	%*s%-*s  rr%���r�)rbr[r]�len�appendr�r�r��wrapr_�extendrI)	rr8�result�opts�	opt_width�indent_first�	help_text�
help_lines�lines	         r�
format_optionzHelpFormatter.format_option(s=�����"�"�6�*���&�&��)<�)<�<�q�@�	��t�9�y� ��� 3� 3�R��>�>�D��-�-�L��$�"5�"5�r�9�d�!K�K�D��L��
�
�d���;�;��+�+�F�3�I�!���y�$�/�/�B�J��M�M�)�|�R��A��&G�G�H��M�M�'1�!�"�~�7�'5�t�%��(:�(:�B��'E�E�'5�7�
8�
�"�X��
��M�M�$���w�w�v����	7s�*D5c��|j�d}|jD]D}|j|�}||j|<t	|t|�|jz�}�F|j�|jD]U}|jD]D}|j|�}||j|<t	|t|�|jz�}�F�W|j�|j�t|dz|j�|_t	|j|jz
d�|_
y)NrrOr�)ru�option_list�format_option_stringsrbrZr�r]�
option_groupsrwrYr\r[rXr_)rrQ�max_len�opt�strings�groups      r�store_option_stringsz"HelpFormatter.store_option_stringsKs�����
����%�%�C��0�0��5�G�'.�D����$��'�3�w�<�$�2E�2E�#E�F�G�&�	
���
��)�)�E��(�(���4�4�S�9��+2��#�#�C�(��g�s�7�|�d�6I�6I�'I�J��)�*�
	
���
����
� ��1��d�.D�.D�E����d�j�j�4�+=�+=�=�r�B��rc��	|j�ry|jxs|jj�}|jD�cgc]}|j
||fz��}}|jD�cgc]}|j||fz��}}n|j}|j}|jr||z}n||z}dj|�Scc}wcc}w)NrH)
�takes_value�metavarr��upper�_short_optsrc�
_long_optsrdr`rI)rr8r��sopt�
short_opts�lopt�	long_optsr�s        rr�z#HelpFormatter.format_option_strings]s���N������n�n�;����(9�(9�(;�G�&,�&8�&8�:�&8�d��-�-��w��?�&8�
�:�&,�%6�%6�8�%6�T��+�+�t�W�o�=�%6�
�8� �+�+�J��)�)�I�����	�)�D��z�)�D��y�y�����:��8s�C�0CN)rr2r3r�r.rhrorrrurwr~r�r�r�r�r�r�r�r�r!rrr
r
�s^��'�R��%�2�2�1���
?�?�
7���I�!�FC�$rr
c�*�eZdZ					dd�Zd�Zd�Zy)rNc�6�tj|||||�yr �r
r.res     rr.zIndentedHelpFormatter.__init__t� ��
	����"�$5�u�k�	Krc��td�|zS)Nz
Usage: %s
)rBr|s  rr~z"IndentedHelpFormatter.format_usage|s�����%�'�'rc�&�d|jd|fzS)Nz%*s%s:
rj)r]r�s  rr�z$IndentedHelpFormatter.format_headings���T�0�0�"�g�>�>�>r)rO�Nr%�rr2r3r.r~r�r!rrrrps%���#$�#%���	K�(�?rrc�*�eZdZ					dd�Zd�Zd�Zy)rNc�6�tj|||||�yr r�res     rr.zTitledHelpFormatter.__init__�r�rc�B�|jtd���d|�d�S)N�Usagez  r�)r�rBr|s  rr~z TitledHelpFormatter.format_usage�s��!�0�0��7��<�e�D�Drc�D�|�dd|jt|�z�d�S)Nr�z=-)r^r�r�s  rr�z"TitledHelpFormatter.format_heading�s��$�d�4�:�:�&6��W��&E�F�Fr)rr�Nrr�r!rrrr�s'���#$�#%���	K�E�Grrc��|ddj�dk(rd}n/|ddj�dk(rd}|ddxsd}n
|dddk(rd}nd}|||�S)	NrO�0x��0b�0r%��
)�lower)�val�type�radixs   r�
_parse_numr��sg��
�2�A�w�}�}��$����	�R�a�����D�	 ����!�"�g�n���	�R�a��C��������U��rc�"�t|t�Sr )r�rS)r�s r�
_parse_intr��s���c�3��r�integerzfloating-point�complex)rS�long�floatr�c��t|j\}}	||�S#t$rtt	d�|||fz��wxYw)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�rWrrB)r8r��value�cvt�whats     r�
check_builtinr��sY���v�{�{�+�K�S�$�G��5�z����G��
�/�0�C��u�3E�E�G�	G�G�s	� �$Ac��||jvr|Sdjtt|j��}t	td�|||fz��)NrHz.option %s: invalid choice: %r (choose from %s))�choicesrI�map�reprrrB)r8r�r�r�s    rrr�sQ����������)�)�C��f�n�n�5�6���
�>�?��E�7�#�
$�%�	%r)�NO�DEFAULTc���eZdZ	gd�ZdZdZdZdZdZdZ	e
e
e
e
ed�Zd	Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZeeeeeeegZ
d�ZeZd�Zd�Zd�Zd�Zd�Z d�Z!y	)r)�actionr�r��default�nargs�constr��callback�
callback_args�callback_kwargsr�r�)
�store�store_const�
store_true�store_falser��append_const�countr�r��version)r�r�r�r�r�r�r�)r�r�r�)r�r�)r�r�)�stringrSr�r�r��choice)rSr�r�r�r�Nc��g|_g|_|j|�}|j|�|j	|�|j
D]
}||��yr )r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr��attrs�checkers    rr.zOption.__init__4sX���������&�&�t�,�����d�#�	
������)�)�G��D�M�*rc�N�|D�cgc]}|s�|��	}}|std��|Scc}w)Nz+at least one option string must be supplied)�	TypeError�rr�r�s   rr�zOption._check_opt_stringsGs3�� $�+�t��s��t��+���I�J�J����,s�"�"c�R�|D]�}t|�dkrtd|z|��t|�dk(r;|ddk(r|ddk7std|z|��|jj|��i|dddk(r|ddk7std|z|��|jj|���y)	NrOz>invalid option string %r: must be at least two characters longr�-r%zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)r�rr�r�r�rs   rrzOption._set_opt_stringsPs����C��3�x�!�|�!�;�=@�A�BF�H�H��S��Q���A��#�
�#�a�&�C�-�%�H�JM�N����� � �'�'��,��A�a��D�(�S��V�s�]�%�C�EH�I�������&�&�s�+�%rc��|jD]>}||vrt||||�||=�|dk(rt||t��2t||d��@|r7t|j	��}tddj
|�z|��y)Nr�zinvalid keyword arguments: %srH)�ATTRS�setattrr��sorted�keysrrI)rr�attrs   rrzOption._set_attrses����J�J�D��u�}���d�E�$�K�0��$�K��9�$��D�$�
�3��D�$��-����5�:�:�<�(�E��/�$�)�)�E�2B�B���
�rc��|j�d|_y|j|jvrtd|jz|��y)Nr�zinvalid action: %r)r��ACTIONSrrs r�
_check_actionzOption._check_actionxs?���;�;��!�D�K�
�[�[����
,��2�T�[�[�@�$�G�G�-rc���|j�5|j|jvr|j�d|_yd|_yyt	|jt�r|jj
|_|jdk(rd|_|j|jvrtd|jz|��|j|jvrtd|jz|��y)Nr�r�r6zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr�
TYPED_ACTIONSrs r�_check_typezOption._check_type~s����9�9���{�{�d�7�7�7��<�<�+� (�D�I�!)�D�I�
8��$�)�)�T�*� �I�I�.�.��	��y�y�E�!�$��	��y�y��
�
�*�!�";�d�i�i�"G��N�N��{�{�$�"4�"4�4�!�:�T�[�[�H�$�P�P�5rc�X�|jdk(rv|j�td|��t|jtt
f�s=tdt
t|j��jd�dz|��y|j�td|jz|��y)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r%z#must not supply choices for type %r)r�r�rr�tuple�listr6�splitrs r�
_check_choicezOption._check_choice�s����9�9�� ��|�|�#�!�E�t�M�M�����u�d�m�<�!�G��$�t�|�|�,�-�3�3�C�8��;�<�=A�C�C�=��\�\�
%��5��	�	�A�4�I�
I�&rc�
�|j|jvxs|jdu}|j�O|rL|jr(|jdddjdd�|_y|jdd|_yyy)NrrOr	rBr%)r��
STORE_ACTIONSr�r�r�r�r�)rr�s  r�_check_destzOption._check_dest�s����{�{�d�&8�&8�8�-��y�y��,�	��9�9������ �O�O�A�.�q�r�2�:�:�3��D��	� �,�,�Q�/��2��	�"-�rc��|j|jvr&|j�td|jz|��yy)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�rrs r�_check_constzOption._check_const�sB���;�;�d�0�0�0�T�Z�Z�5K��<�t�{�{�J���
�6L�0rc��|j|jvr|j�d|_yy|j�td|jz|��y)Nr%z*'nargs' must not be supplied for action %r)r�rr�rrs r�_check_nargszOption._check_nargs�sU���;�;�$�,�,�,��z�z�!���
�"�
�Z�Z�
#��<�t�{�{�J���
�$rc�(�|jdk(r�t|j�std|jz|��|j�3t|jt�std|jz|��|j�4t|jt�std|jz|��yy|j�td|jz|��|j�td|��|j�td|��y)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�rr�rrr��dictrs r�_check_callbackzOption._check_callback�s/���;�;�*�$��D�M�M�*�!�/�$�-�-�?��G�G��"�"�.��t�1�1�5�9�!�I��(�(�)�*.�0�0��$�$�0��t�3�3�T�:�!�J��*�*�+�,0�2�2�;�1��}�}�(�!�D��m�m�$�%)�+�+��!�!�-�!�D�d�L�L��#�#�/�!�F��N�N�0rc�R�dj|j|jz�S)N�/)rIr�r�rs rr0zOption.__str__�s ���x�x��(�(�4�?�?�:�;�;rc��|jduSr )r�rs rr�zOption.takes_value�s���y�y��$�$rc�V�|jr|jdS|jdS�Nr)r�r�rs r�get_opt_stringzOption.get_opt_string�s)���?�?��?�?�1�%�%��#�#�A�&�&rc�h�|jj|j�}|�|S||||�Sr )�TYPE_CHECKERr�r�)rr�r�rs    r�check_valuezOption.check_value�s5���#�#�'�'��	�	�2���?��L��4��e�,�,rc	��|�J|jdk(r|j||�St|D�cgc]}|j||���c}�Sycc}wr$)r�r4r)rr�r��vs    r�
convert_valuezOption.convert_valuesX�����z�z�Q���'�'��U�3�3���F��1�d�.�.�s�A�6��F�G�G�	��Gs�Ac�z�|j||�}|j|j|j||||�Sr )r7�take_actionr�r�)rr�r��valuesrQs     r�processzOption.processsB���"�"�3��.��
����K�K����C����@�	@rc���|dk(rt|||�y|dk(rt|||j�y|dk(rt||d�y|dk(rt||d�y|dk(r"|j|g�j|�y|dk(r,|j|g�j|j�y|d	k(r!t|||j|d
�dz�y|dk(r:|jxsd
}|j
xsi}|j||||g|��i|��y|dk(r!|j�|j�y|dk(r!|j�|j�ytd|jz��)Nr�r�r�Tr�Fr�r�r�rr%r�r!r�r�zunknown action %r)r
r��ensure_valuer�r�r�r��
print_help�exit�
print_versionrWr�)	rr�r�r�r�r:rQ�args�kwargss	         rr9zOption.take_actions����W���F�D�%�(�4�3�}�
$��F�D�$�*�*�-�0�/�|�
#��F�D�$�'�,�+�}�
$��F�D�%�(�(�'�x�
�����b�)�0�0��7�$�#�~�
%�����b�)�0�0����<� ��w�
��F�D�&�"5�"5�d�A�">��"B�C���z�
!��%�%�+��D��)�)�/�R�F��D�M�M�$��U�F�D�T�D�V�D���v�
������K�K�M��
�y�
 �� � �"��K�K�M���0�4�;�;�>�?�?r)"rr2r3rrr!rrr$rr�rr3rr.r�rrrrrr"r%r'r+r0r�__repr__r�r1r4r7r;r9r!rrrr�s����*
�E�	�G��M�!�M�&��%�M�

D�E�$!.� -� -� -� ,�	�L� �M�
�&�,�*�&H�P�0I�
3���N�8#� �"� �!�!�$�
&�M�<��H�%�'�-�H�
@�rr�SUPPRESSHELP�
SUPPRESSUSAGEc�L�eZdZdd�Zd�ZeZd�Zd�Zd�Z	d�Z
dd�Zdd	�Zd
�Z
y)
rNc�T�|r&|j�D]\}}t|||��yyr )�itemsr
)rr�rr�s    rr.zValues.__init__9s+���'�~�~�/���s���d�C�(� 0�rc�,�t|j�Sr )r6�__dict__rs rr0zValues.__str__>s���4�=�=�!�!rc��t|t�r|j|jk(St|t�r|j|k(StSr )rrrJr*�NotImplemented)r�others  r�__eq__z
Values.__eq__Cs>���e�V�$��=�=�E�N�N�2�2�
��t�
$��=�=�E�)�)�!�!rc�Z�	t|�D]}||vs�||}|��t|||��yr )�dirr
)rr*r�dvals    r�_update_carefulzValues._update_carefulKs9��	���I�D��t�|��D�z���#��D�$��-�	rc�<�	|jj|�yr )rJ�update)rr*s  r�
_update_loosezValues._update_looseXs��	�
	
�
�
���T�"rc�z�|dk(r|j|�y|dk(r|j|�ytd|z��)N�careful�loosezinvalid update mode: %r)rRrUrW)rr*�modes   r�_updatezValues._update`s>���9��� � ��&�
�W�_����t�$��6��=�>�>rc�v�t|�tj|}|jt	|�|�yr )�
__import__�sys�modulesrZ�vars)r�modnamerY�mods    r�read_modulezValues.read_modulehs*���7���k�k�'�"�����T�#�Y��%rc�r�i}tt|�j�|�|j||�yr )�exec�open�readrZ)r�filenamerYr_s    r�	read_filezValues.read_filems,�����T�(�^�
 �
 �
"�D�)����T�4� rc�d�t||�rt||��
t|||�t||�Sr )�hasattr�getattrr
)rrr�s   rr=zValues.ensure_valuers1���t�T�"�g�d�D�&9�&A��D�$��&��t�T�"�"rr )rW)rr2r3r.r0rrCrNrRrUrZrbrhr=r!rrrr7s6��)�
"��H�"�.�#�?�&�
!�
#rrc�n�eZdZ	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zy)rc�v�|j�||_|j|�|j|�yr )�_create_option_list�option_class�set_conflict_handler�set_description)rro�conflict_handlerr�s    rr.zOptionContainer.__init__�s5��
	
� � �"�(����!�!�"2�3����[�)rc�.�i|_i|_i|_yr ��
_short_opt�	_long_optr�rs r�_create_option_mappingsz'OptionContainer._create_option_mappings�s����������
rc�j�|j|_|j|_|j|_yr rtrgs  r�_share_option_mappingsz&OptionContainer._share_option_mappings�s)��!�+�+����)�)�������
rc�6�|dvrtd|z��||_y)N)�error�resolvez$invalid conflict_resolution value %r)rWrr)r�handlers  rrpz$OptionContainer.set_conflict_handler�s$���.�.��C�g�M�N�N� '��rc��||_yr �r�r�s  rrqzOptionContainer.set_description�s
��&��rc��|jSr rrs r�get_descriptionzOptionContainer.get_description�s�����rc��	|`|`|`yr rtrs r�destroyzOptionContainer.destroy�s��)��O��N��Mrc
��g}|jD]1}||jvs�|j||j|f��3|jD]1}||jvs�|j||j|f��3|r�|j
}|dk(r/t
ddj|D�cgc]}|d��	c}�z|��|dk(r�|D]�\}}|jd�r)|jj|�|j|=n(|jj|�|j|=|jr�u|jr��|jjj|���yyycc}w)Nr{z conflicting option string(s): %srHrr|r
)r�rur�r�rvrrrrI�
startswith�remove�	containerr�)rr8�
conflict_optsr�r}�co�c_options       r�_check_conflictzOptionContainer._check_conflict�sh���
��%�%�C��d�o�o�%��$�$�c�4�?�?�3�+?�%@�A�&��$�$�C��d�n�n�$��$�$�c�4�>�>�#�+>�%?�@�%���+�+�G��'�!�)�6��i�i�� ?��2��A��� ?�@�A�����I�%�'4�O�S�(��~�~�d�+� �+�+�2�2�3�7� �N�N�3�/� �,�,�3�3�C�8� �O�O�C�0�$�0�0�H�4G�4G� �*�*�6�6�=�=�h�G�(5�&���
!@s�+E8c��	t|dt�r|j|i|��}n>t|�dk(r%|s#|d}t|t�std|z��td��|j
|�|jj|�||_	|jD]}||j|<�|jD]}||j|<�|j�h|jt ur%|j|j"|j<|S|j|j"vrd|j"|j<|S)Nrr%znot an Option instance: %r�invalid arguments)rr6ror�rrr�r�r�r�r�rur�rvr�r�r�r�)rrArBr8r�s     r�
add_optionzOptionContainer.add_option�s/��	��d�1�g�s�#�&�T�&�&��7��7�F�
��Y�!�^�F��!�W�F��f�f�-�� <�v� E�F�F��/�0�0����V�$�������'�����%�%�C�#)�D�O�O�C� �&��$�$�C�"(�D�N�N�3��%��;�;�"��~�~�Z�/�-3�^�^��
�
�f�k�k�*��
����D�M�M�1�-1��
�
�f�k�k�*��
rc�4�|D]}|j|��yr )r�)rr�r8s   r�add_optionszOptionContainer.add_optionss��!�F��O�O�F�#�"rc�r�|jj|�xs|jj|�Sr )rur�rvr@s  r�
get_optionzOptionContainer.get_options0�����#�#�G�,�,����"�"�7�+�	-rc�>�||jvxs||jvSr )rurvr@s  r�
has_optionzOptionContainer.has_options$���4�?�?�*�*��4�>�>�)�	+rc�V�|jj|�}|�|jj|�}|�td|z��|jD]}|j|=�|j
D]}|j|=�|jjj|�y)Nzno such option %r)	rur�rvrWr�r�r�r�r�)rr?r8r�s    r�
remove_optionzOptionContainer.remove_options������$�$�W�-���>��^�^�'�'��0�F��>��0�7�:�;�;��%�%�C�����$�&��$�$�C����s�#�%����$�$�+�+�F�3rc���|jsyg}|jD]5}|jtus�|j|j	|���7dj|�S�Nrj)r�r�rr�r�rI)r�	formatterr�r8s    r�format_option_helpz"OptionContainer.format_option_helpsV���������&�&�F��;�;�-�/��
�
�i�5�5�f�=�>�'��w�w�v��rc�@�|j|j��Sr )r�r��rr�s  rr�z"OptionContainer.format_description(s���+�+�D�,@�,@�,B�C�Crc���g}|jr |j|j|��|jr |j|j	|��dj|�S)Nr�)r�r�r�r�r�rI�rr�r�s   r�format_helpzOptionContainer.format_help+sV��������M�M�$�1�1�)�<�=�����M�M�$�1�1�)�<�=��y�y�� � rN)rr2r3r.rwryrprqr�r�r�r�r�r�r�r�r�r�r�r!rrrrxsY���<	*��(�(�
'� ��H�6�<$�-�+�4� �D�!rrc�,�eZdZdd�Zd�Zd�Zd�Zd�Zy)rNc�x�||_tj||j|j|�||_yr )rQrr.rorr�title)rrQr�r�s    rr.zOptionGroup.__init__6s4������ � ��&�%�%�v�'>�'>��	M���
rc�H�g|_|j|j�yr )r�ryrQrs rrnzOptionGroup._create_option_list<s������#�#�D�K�K�0rc��||_yr )r�)rr�s  r�	set_titlezOptionGroup.set_title@s	����
rc�4�	tj|�|`yr )rr�r�rs rr�zOptionGroup.destroyCs��)�����%��rc��|j|j�}|j�|tj	||�z
}|j�|Sr )r�r�rurr�rwr�s   rr�zOptionGroup.format_helpJsJ���)�)�$�*�*�5�������/�-�-�d�I�>�>�������
rr )rr2r3r.rnr�r�r�r!rrrr4s���1���rrc
��eZdZ	gZddedddddddf
d�Zd�Zd�Zd�Zd�Z	d)d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd*d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd+d�Z d �Z!d!�Z"d,d"�Z#d#�Z$d,d$�Z%d,d%�Z&d&�Z'd,d'�Z(d,d(�Z)y)-r	Nr{Tc�>�tj||||�|j|�|	|_||_d|_d|_|�
t�}||_|jj|�|
|_
|j||��|j�y)NT)�add_help)
rr.�	set_usage�progr��allow_interspersed_args�process_default_valuesrr�rhr��_populate_option_list�_init_parsing_state)rr}r�ror�rrr�r��add_help_optionr�r�s           rr.zOptionParser.__init__�s���	� � ��,� 0�+�	?����u����	����'+��$�&*��#���-�/�I�"������!�!�$�'����	
�"�"�;�,;�	#�	=�	
� � �"rc�~�	tj|�|jD]}|j��|`|`|`yr )rr�r�r�r�)rr�s  rr�zOptionParser.destroy�sA��	�	����%��'�'�E��M�M�O�(������Nrc�@�g|_g|_|j�yr )r�r�rwrs rrnz OptionParser._create_option_list�s���������$�$�&rc�@�|jdddtd���y)Nz-hz--helpr�zshow this help message and exit�r�r��r�rBrs r�_add_help_optionzOptionParser._add_help_option�s$������h�%��@�A�	�	Crc�>�|jddtd���y)Nz	--versionr�z&show program's version number and exitr�r�rs r�_add_version_optionz OptionParser._add_version_option�s"������(��G�H�	�	Jrc���|jr|j|j�|r|j|�|jr|j�|r|j	�yyr )�standard_option_listr�r�r�r�)rr�r�s   rr�z"OptionParser._populate_option_list�sW���$�$����T�6�6�7�����[�)��<�<��$�$�&���!�!�#�rc�.�d|_d|_d|_yr )�rargs�largsr:rs rr�z OptionParser._init_parsing_state�s����
���
���rc��|�td�|_y|turd|_y|j�j	d�r|dd|_y||_y)Nz%prog [options]zusage: �)rBr}rr�r�r|s  rr�zOptionParser.set_usage�sK���=��,�-�D�J�
�n�
$��D�J�
�[�[�]�
%�
%�i�
0��q�r��D�J��D�Jrc��	d|_y)NT�r�rs r�enable_interspersed_argsz%OptionParser.enable_interspersed_args�s��	$�
(,��$rc��	d|_y)NFr�rs r�disable_interspersed_argsz&OptionParser.disable_interspersed_argss��	�
(-��$rc��||_yr )r�)rr;s  r�set_process_default_valuesz'OptionParser.set_process_default_valuess
��&-��#rc�"�||j|<yr )r�)rr�r�s   r�set_defaultzOptionParser.set_defaults��#��
�
�d�rc�:�|jj|�yr )r�rT)rrBs  r�set_defaultszOptionParser.set_defaultss���
�
���V�$rc�|�|jdd}|jD]}|j|j��|Sr )r�r�r�)r�optionsr�s   r�_get_all_optionszOptionParser._get_all_optionss9���"�"�1�%���'�'�E��N�N�5�,�,�-�(��rc�n�|jst|j�S|jj�}|j	�D]]}|j|j�}t|t�s�/|j�}|j||�||j<�_t|�Sr )r�rr��copyr�r�r�rr6r1r4)rr�r8r�r?s     r�get_default_valueszOptionParser.get_default_valuess����*�*��$�-�-�(�(��=�=�%�%�'���+�+�-�F��l�l�6�;�;�/�G��'�3�'� �/�/�1��(.�(:�(:�7�G�(L�����%�	.��h��rc�0�t|dt�rt|g|��i|��}nWt|�dk(r>|s<|d}t|t�st	d|z��|j
|urt
d��t	d��|jj|�|S)Nrr%znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r�)	rr6rr�rrQrWr�r�)rrArBr�s    r�add_option_groupzOptionParser.add_option_group+s����d�1�g�s�#���6�t�6�v�6�E�
��Y�!�^�F���G�E��e�[�1�� A�E� I�J�J��|�|�4�'� �!E�F�F��/�0�0����!�!�%�(��rc��|jj|�xs|jj|�}|r|j|ur|jSyr )rur�rvr�)rr?r8s   r�get_option_groupzOptionParser.get_option_group;sO���/�/�%�%�g�.�.��.�.�$�$�W�-�	��f�&�&�d�2��#�#�#�rc�6�|�tjddS|ddSr$)r]�argv)rrAs  r�	_get_argszOptionParser._get_argsEs ���<��8�8�A�B�<����7�Nrc�:�	|j|�}|�|j�}||_gx|_}||_	|j|||�}||z}|j||�S#ttf$r$}|jt|��Yd}~�Ed}~wwxYwr )r�r�r�r�r:�
_process_argsrrr{r6�check_values)rrAr:r�r��stop�errs       r�
parse_argszOptionParser.parse_argsKs���	����t�$���>��,�,�.�F���
����
�U����	!��%�%�e�U�F�;�D��u�}��� � ���.�.��	� 0�1�	!��J�J�s�3�x� � ��	!�s�A'�'B�6B�Bc��	||fSr r!)rr:rAs   rr�zOptionParser.check_valuesrs��		���~�rc��	|rx|d}|dk(r|d=y|dddk(r|j||�nK|dddk(r!t|�dkDr|j||�n"|jr|j	|�|d=ny|r�wyy)Nrr
rOr%r	)�_process_long_optr��_process_short_optsr�r�)rr�r�r:�args     rr�zOptionParser._process_argss���	����(�C��d�{��!�H���Q�q��T�!��&�&�u�f�5��R�a��C��C��H�q�L��(�(���7��-�-����S�!��!�H��'rc�0�	t||j�Sr )�
_match_abbrevrv)rr�s  r�_match_long_optzOptionParser._match_long_opt�s��	��S�$�.�.�1�1rc�&�|jd�}d|vr*|jdd�\}}|jd|�d}n|}d}|j|�}|j|}|j�rh|j}t|�|kr#|jtdd|�||d�z�nM|dk(r|jd�}	n6t|d|�}	|d|�=n"|r|jtd	�|z�nd}	|j|	||�y)
Nrrqr%TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r8�numberz%s option does not take a value)
�popr�insertr�rvr�r�r�r{rrrBr;)
rr�r:r�r��next_arg�had_explicit_valuer8r�r�s
          rr�zOptionParser._process_long_opt�s���i�i��l���#�:�!�i�i��Q�/�O�S�(��L�L��H�%�!%���C�!&���"�"�3�'������$�������L�L�E��5�z�E�!��
�
�8�D�E���),�u�=�>�?��!���	�	�!����e�A�e�n�-���!�E�'�N�
��J�J�q�:�;�c�A�B��E����s�E�6�4�0rc��|jd�}d}d}|ddD]�}d|z}|jj|�}|dz
}|st|��|j	�r�|t|�kr|j
d||d�d}|j}	t|�|	kr#|jtdd|	�||	d�z�n-|	dk(r|jd�}
nt|d|	�}
|d|	�=nd}
|j|
||�|s��yy)	NrFr%r	Tr�r�r�)r�rur�rr�r�r�r�r{rrr;)rr�r:r�r��i�chr�r8r�r�s           rr�z OptionParser._process_short_opts�s"���i�i��l����
���a�b�'�B���(�C��_�_�(�(��-�F�
��F�A��$�S�)�)��!�!�#��s�3�x�<��L�L��C���G�,��D������u�:��%��J�J�x�H�I�� �-0�5�!A� B�C��a�Z�!�I�I�a�L�E�!�%��%�.�1�E��a��g�����N�N�3��v�t�4���Arc��|j�0tjjtj
d�S|jSr0)r�rT�path�basenamer]r�rs r�
get_prog_namezOptionParser.get_prog_names3���9�9���7�7�#�#�C�H�H�Q�K�0�0��9�9�rc�B�|jd|j��S)Nz%prog)r�r�)r�ss  r�expand_prog_namezOptionParser.expand_prog_names���y�y��$�"4�"4�"6�7�7rc�8�|j|j�Sr )r�r�rs rr�zOptionParser.get_descriptions���$�$�T�%5�%5�6�6rc�p�|rtjj|�tj|�yr )r]�stderr�writer?)r�statusr,s   rr?zOptionParser.exits#����J�J���S�!�����rc��	|jtj�|jd|j	��d|�d��y)NrOz	: error: r�)�print_usager]r�r?r�r-s  rr{zOptionParser.errors7��	�	
������$��	�	�!�$�*<�*<�*>��D�Erc��|jr4|jj|j|j��Syr�)r}r�r~r�rs r�	get_usagezOptionParser.get_usage#s7���:�:��>�>�.�.��%�%�d�j�j�1�3�
3�rc�V�	|jrt|j�|��yy�N)�file)r}�printr�rrs  rrzOptionParser.print_usage*s&��	��:�:��$�.�.�"��.�rc�R�|jr|j|j�Syr�)r�r�rs r�get_versionzOptionParser.get_version6s!���<�<��(�(����6�6�rc�V�	|jrt|j�|��yyr)r�rr	rs  rr@zOptionParser.print_version<s(��	��<�<��$�"�"�$�4�0�rc��|�|j}|j|�g}|j|jt	d���|j�|jr6|jtj||��|jd�|jD]3}|j|j|��|jd��5|j�dj|dd�S)N�Optionsr�rjr�)
r�r�r�r�rBrur�rr�r�r�rwrI)rr�r�r�s    rr�zOptionParser.format_option_helpGs��������I��&�&�t�,����
�
�i�.�.�q��|�<�=���������M�M�/�<�<�T�9�M�N��M�M�$���'�'�E��M�M�%�+�+�I�6�7��M�M�$��(�	�����w�w�v�c�r�{�#�#rc�8�|j|j�Sr )r�r�r�s  rr�zOptionParser.format_epilogXs���&�&�t�{�{�3�3rc�~�|�|j}g}|jr"|j|j�dz�|jr#|j|j|�dz�|j|j
|��|j|j|��dj|�Sr�)	r�r}r�rr�r�r�r�rIr�s   rr�zOptionParser.format_help[s��������I����:�:��M�M�$�.�.�*�T�1�2�����M�M�$�1�1�)�<�t�C�D��
�
�d�-�-�i�8�9��
�
�d�(�(��3�4��w�w�v��rc�h�	|�tj}|j|j��yr )r]�stdoutr�r�rs  rr>zOptionParser.print_helpgs,��	�
�<��:�:�D��
�
�4�#�#�%�&r)T)NN)rNr )*rr2r3r�rr.r�rnr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r?r{rrr	r@r�r�r�r>r!rrr	r	Rs���B�H���!�$��")�!��!%���#�D�$'�
C�
J�
$��	�,�-�.�$�%�� �"� ��%/�N��f2�"1�H$�R�8�7��
F��
/��	1�$�"4�
�'rr	c���	||vr|S|j�D�cgc]}|j|�r|��}}t|�dk(r|dS|st|��|j	�t||��cc}w)Nr%r)rr�r�r�sortrD)r��wordmap�wordrFs    rr�r�ts����	�G�|���+2�,�,�.�0�.�$� �O�O�A�.��.�
�0��}���"� ��#�#�� ��#�#�
��� �&�q�-�8�8��0s�A2)&�__version__�__all__�
__copyright__r]rTr�rrr�ImportErrorrB�	Exceptionr
rrrrrDr
rrr�r�r�r�r�r�rr�rrrrrrr	r�rr!rr�<module>rsy���.����$�
�@��J�	�)����Y���=�� �;��
�
��6�m�6�
A�N�
A�M�M�^?�]�?�&G�=�G�&� �%�a�	�l�3�%�q��|�4�!�1�%5�#6�7�%�q��|�4�7��
G�%��
�n�n�f"�
�#��>#�>#�By!�y!�x�?��<]'�O�]'�D9�:���m1����	�s�C9�9D�D

?>