Hacked By AnonymousFox

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

�

c��f�����dZdZgd�ZdZddlZddlZddlZd�Z	ddlmZm	Z	n#e
$r	d�Zd	�Z	YnwxYweZGd
�de��Z
Gd�d
e
��ZGd�de��ZGd�de
��ZGd�de
��ZGd�de��ZGd�d��ZGd�de��ZGd�de��Zd�Zd�Zeed��feed��feed��feed ��fd!�Zd"�Zd#�Zd$ZGd%�d&��Zd'Zd(Z Gd)�d*��Z!Gd+�d,��Z"Gd-�d.e"��Z#Gd/�d0e"��Z$d1�Z%eZ&dS)2a�A powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
z1.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�@�d|jjt|��|fzS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��selfs �//opt/alt/python311/lib64/python3.11/optparse.py�_reprrOs�����!8�"�T�(�(�D� I�I�I�)�gettext�ngettextc��|S�N�)�messages rrr\s���rc��|dkr|S|S�N�r!)�singular�plural�ns   rrr_s����6�6��O��
rc��eZdZd�Zd�ZdS)r
c��||_dSr ��msg�rr,s  r�__init__zOptParseError.__init__hs
������rc��|jSr r+rs r�__str__zOptParseError.__str__ks	���x�rN)r�
__module__�__qualname__r.r0r!rrr
r
gs2�������������rr
c��eZdZdZd�Zd�ZdS)rz]
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    c�<�||_t|��|_dSr )r,�str�	option_id)rr,�options   rr.zOptionError.__init__us������V������rc�B�|jrd|j�d|j��S|jS)Nzoption z: )r6r,rs rr0zOptionError.__str__ys-���>�	�	�&*�n�n�n�d�h�h�?�?��8�OrN�rr1r2�__doc__r.r0r!rrrros<��������
%�%�%�����rrc��eZdZdZdS)rzE
    Raised if conflicting options are added to an OptionParser.
    N�rr1r2r:r!rrrrs���������rrc��eZdZdZdS)rzS
    Raised if an invalid option value is encountered on the command
    line.
    Nr<r!rrrr�s���������rrc��eZdZdZd�Zd�ZdS)rzB
    Raised if an invalid option is seen on the command line.
    c��||_dSr )�opt_str�rr@s  rr.zBadOptionError.__init__�s
������rc�0�td��|jzS)Nzno such option: %s)�_r@rs rr0zBadOptionError.__str__�s���%�&�&���5�5rNr9r!rrrr�s<�����������6�6�6�6�6rrc��eZdZdZd�Zd�ZdS)�AmbiguousOptionErrorzD
    Raised if an ambiguous option is seen on the command line.
    c�J�t�||��||_dSr )rr.�
possibilities)rr@rGs   rr.zAmbiguousOptionError.__init__�s&������g�.�.�.�*����rc�d�td��|jd�|j��fzS)Nzambiguous option: %s (%s?)�, )rCr@�joinrGrs rr0zAmbiguousOptionError.__str__�s3���.�/�/��<����4�+=�!>�!>�?�@�	ArNr9r!rrrErE�sA��������+�+�+�A�A�A�A�ArrEc�p�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�ZdS)r
a�
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    �nonec��d|_||_|�?	ttjd��}n#t
tf$rd}YnwxYw|dz}||_t|t|dz
|dz����x|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	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�rrSr]rYras     rr.zHelpFormatter.__init__�s���
��� 0����=�
��B�J�y�1�2�2�����j�)�
�
�
�����
�����Q�J�E���
��%�s�5�2�:�7G�!�7K�'L�'L�M�M�	N���T�3������
����&���%��� ���%���$����s�2�A�Ac��||_dSr )rR�rrRs  r�
set_parserzHelpFormatter.set_parser�s
������rc�L�|dvrtd|z���d|zdz|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)rXrd�r�delims  r�set_short_opt_delimiterz%HelpFormatter.set_short_opt_delimiter�sA���	�!�!��A�E�I�K�K�
K�"�U�l�T�1����rc�L�|dvrtd|z���d|zdz|_dS)N)�=rlz.invalid metavar delimiter for long options: %rrm)rXrerns  r�set_long_opt_delimiterz$HelpFormatter.set_long_opt_delimiter�sA���
�"�"��@�5�H�J�J�
J�!�E�\�D�0����rc�P�|xj|jz
c_|xjdz
c_dSr$�r^rSr_rs r�indentzHelpFormatter.indent�s,�����t�4�4����
�
�a��
�
�
�
rc�z�|xj|jzc_|jdks
Jd���|xjdzc_dS)NrzIndent decreased below 0.r%rurs r�dedentzHelpFormatter.dedent�sI�����t�4�4����"�a�'�'�'�)D�'�'�'��
�
�a��
�
�
�
rc� �td����Nzsubclasses must implement��NotImplementedError�r�usages  r�format_usagezHelpFormatter.format_usage����!�"=�>�>�>rc� �td���rzr{�r�headings  r�format_headingzHelpFormatter.format_headingr�rc��t|j|jz
d��}d|jz}tj||||���S)z�
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        �rl)�initial_indent�subsequent_indent)r[rYr^�textwrap�fill)r�text�
text_widthrvs    r�_format_textzHelpFormatter._format_textsN��
���d�&9�9�2�>�>�
��T�(�(���}�T�'�,2�/5�7�7�7�	7rc�:�|r|�|��dzSdS�N�
rk�r��r�descriptions  r�format_descriptionz HelpFormatter.format_descriptions(���	��$�$�[�1�1�D�8�8��2rc�@�|rd|�|��zdzSdSr�r�)r�epilogs  r�
format_epilogzHelpFormatter.format_epilogs-���	��$�+�+�F�3�3�3�d�:�:��2rc���|j�|js|jS|jj�|j��}|tus|�|j}|j�|jt|����Sr )
rRrb�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer5)rr7�
default_values   r�expand_defaultzHelpFormatter.expand_defaultso���;��d�&6���;����,�0�0���=�=�
��J�&�&�-�*?� �1�M��{�"�"�4�#3�S��5G�5G�H�H�Hrc�N��g}�j|}�j�jz
dz
}t|��|krd�jd|fz}�j}nd�jd||fz}d}|�|��|jrz��|��}tj|�j	��}|�d|d|dfz��|�
�fd�|dd�D����n!|dd	kr|�d	��d�|��S)
NrP�%*s%s
rkz	%*s%-*s  rc�*��g|]}d�jd|fz��S)r�rk)r\)�.0�liners  �r�
<listcomp>z/HelpFormatter.format_option.<locals>.<listcomp>Es8���7�7�7�#�%��(:�B��'E�E�7�7�7rr%���r�)rcr\r^�len�appendr�r�r��wrapr`�extendrJ)rr7�result�opts�	opt_width�indent_first�	help_text�
help_liness`       r�
format_optionzHelpFormatter.format_option(sT������"�6�*���&��)<�<�q�@�	��t�9�9�y� � ��� 3�R��>�>�D��-�L�L��$�"5�r�9�d�!K�K�D��L��
�
�d�����;�	 ��+�+�F�3�3�I�!��y�$�/�B�B�J��M�M�)�|�R��A��&G�G�H�H�H��M�M�7�7�7�7�'1�!�"�"�~�7�7�7�
8�
8�
8�
8�
�"�X��
�
��M�M�$�����w�w�v���rc�t�|���d}|jD]F}|�|��}||j|<t	|t|��|jz��}�G|���|jD]P}|jD]F}|�|��}||j|<t	|t|��|jz��}�G�Q|���|���t|dz|j
��|_t	|j|jz
d��|_
dS)NrrPr�)rv�option_list�format_option_stringsrcr[r�r^�
option_groupsrxrZr]r\rYr`)rrR�max_len�opt�strings�groups      r�store_option_stringsz"HelpFormatter.store_option_stringsKs5�����
�
�
����%�	G�	G�C��0�0��5�5�G�'.�D���$��'�3�w�<�<�$�2E�#E�F�F�G�G����
�
�
��)�	K�	K�E��(�
K�
K���4�4�S�9�9��+2��#�C�(��g�s�7�|�|�d�6I�'I�J�J���
K�	
���
�
�
����
�
�
� ��1��d�.D�E�E����d�j�4�+=�=�r�B�B����rc�*���|���rI|jp|j������fd�|jD��}��fd�|jD��}n|j}|j}�jr||z}n||z}d�|��S)z@Return a comma-separated list of option strings & metavariables.c�(��g|]}�j|�fz��Sr!)rd)r��sopt�metavarrs  ��rr�z7HelpFormatter.format_option_strings.<locals>.<listcomp>as5���:�:�:�"��-��w��?�:�:�:rc�(��g|]}�j|�fz��Sr!)re)r��loptr�rs  ��rr�z7HelpFormatter.format_option_strings.<locals>.<listcomp>cs5���8�8�8�!��+�t�W�o�=�8�8�8rrI)�takes_valuer�r��upper�_short_opts�
_long_optsrarJ)rr7�
short_opts�	long_optsr�r�s`    @rr�z#HelpFormatter.format_option_strings]s����������	*��n�;���(9�(9�(;�(;�G�:�:�:�:�:�&,�&8�:�:�:�J�8�8�8�8�8�%+�%6�8�8�8�I�I� �+�J��)�I���	*��	�)�D�D��z�)�D��y�y����rN)rr1r2r:r�r.rirprsrvrxrr�r�r�r�r�r�r�r�r!rrr
r
�s������'�'�R��%�%�%�2���2�2�2�1�1�1�������
?�?�?�?�?�?�
7�
7�
7�������I�I�I�!�!�!�FC�C�C�$����rr
c�.�eZdZdZ				d	d�Zd�Zd�ZdS)
rz.Format help with indented section bodies.
    rP�Nr%c�B�t�|||||��dSr �r
r.rfs     rr.zIndentedHelpFormatter.__init__t�8��
	����"�$5�u�k�	K�	K�	K�	K�	Krc�&�td��|zS)Nz
Usage: %s
)rCr}s  rrz"IndentedHelpFormatter.format_usage|s������%�'�'rc��d|jd|fzS)Nz%*s%s:
rk)r^r�s  rr�z$IndentedHelpFormatter.format_headings���T�0�"�g�>�>�>r)rPr�Nr%�rr1r2r:r.rr�r!rrrrpsb��������#$�#%���	K�K�K�K�(�(�(�?�?�?�?�?rrc�.�eZdZdZ				dd�Zd�Zd�ZdS)	rz1Format help with underlined section headers.
    rr�Nc�B�t�|||||��dSr r�rfs     rr.zTitledHelpFormatter.__init__�r�rc�R�|�td�����d|�d�S)N�Usagez  r�)r�rCr}s  rrz TitledHelpFormatter.format_usage�s+��!�0�0��7���<�<�<�<�e�e�e�D�Drc�H�|�dd|jt|��z�d�S)Nr�z=-)r_r�r�s  rr�z"TitledHelpFormatter.format_heading�s)��$�W�W�d�4�:�&6��W���&E�&E�&E�F�Fr)rr�Nrr�r!rrrr�sj��������#$�#%���	K�K�K�K�E�E�E�G�G�G�G�Grrc���|dd����dkrd}nB|dd����dkrd}|dd�pd}n|dd�dkrd}nd}|||��S)	NrP�0x��0b�0r%��
)�lower)�val�type�radixs   r�
_parse_numr��s���
�2�A�2�w�}�}���$������	�R�a�R������D�	 �	 ����!�"�"�g�n����	�R�a�R��C���������4��U���rc�,�t|t��Sr )r�rT)r�s r�
_parse_intr��s���c�3���r�integerzfloating-point�complex)rT�long�floatr�c��t|j\}}	||��S#t$r#tt	d��|||fz���wxYw)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�rXrrC)r7r��value�cvt�whats     r�
check_builtinr��sr���v�{�+�K�S�$�G��s�5�z�z����G�G�G��
�/�0�0�C��u�3E�E�G�G�	G�G���s	�
"�-Ac��||jvr|Sd�tt|j����}t	td��|||fz���)NrIz.option %s: invalid choice: %r (choose from %s))�choicesrJ�map�reprrrC)r7r�r�r�s    rrr�s^����������)�)�C��f�n�5�5�6�6���
�>�?�?��E�7�#�
$�%�%�	%r)�NO�DEFAULTc���eZdZdZgd�ZdZdZdZdZdZ	dZ
eeeeed	�Z
d
Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZeeeeeeegZd�ZeZd�Zd�Zd�Zd�Z d�Z!d�Z"d
S)rar
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    )�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�rr)r�r�r�)r�r�)r�r)�stringrTr�r�r��choice)rTr�r�r�rNc���g|_g|_|�|��}|�|��|�|��|jD]
}||���dSr )r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr��attrs�checkers    rr.zOption.__init__4s{���������&�&�t�,�,�����d�#�#�#�	
��������)�	�	�G��G�D�M�M�M�M�	�	rc�@�d�|D��}|std���|S)Nc��g|]}|�|��Sr!r!)r�r�s  rr�z-Option._check_opt_strings.<locals>.<listcomp>Ks��+�+�+��s�+��+�+�+rz+at least one option string must be supplied)�	TypeError)rr�s  rrzOption._check_opt_stringsGs4��,�+�t�+�+�+���	K��I�J�J�J��rc��|D]�}t|��dkrtd|z|���t|��dkrF|ddkr|ddkstd|z|���|j�|����|dd�dkr|ddkstd|z|���|j�|����dS)	NrPz>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�)rr�r�s   rrzOption._set_opt_stringsPs���	,�	,�C��3�x�x�!�|�|�!�;�=@�A�BF�H�H�H��S���Q����A��#�
�
�#�a�&�C�-�-�%�H�JM�N������ �'�'��,�,�,�,��A�a�C��D�(�(�S��V�s�]�]�%�C�EH�I�������&�&�s�+�+�+�+�%	,�	,rc�F�|jD]O}||vrt||||��||=�!|dkrt||t���>t||d���P|rGt|�����}tdd�|��z|���dS)Nr�zinvalid keyword arguments: %srI)�ATTRS�setattrr��sorted�keysrrJ)rr
�attrs   rrzOption._set_attrses����J�	.�	.�D��u�}�}���d�E�$�K�0�0�0��$�K�K��9�$�$��D�$�
�3�3�3�3��D�$��-�-�-�-��	��5�:�:�<�<�(�(�E��/�$�)�)�E�2B�2B�B����
�	�	rc�r�|j�	d|_dS|j|jvrtd|jz|���dS)Nr�zinvalid action: %r)r��ACTIONSrrs r�
_check_actionzOption._check_actionxsD���;��!�D�K�K�K�
�[���
,�
,��2�T�[�@�$�G�G�G�-�
,rc�x�|j�)|j|jvr|j�	d|_dSd|_dSdSt	|jt��r|jj|_|jdkrd|_|j|jvrtd|jz|���|j|jvrtd|jz|���dS)Nrrr5zinvalid 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���{�d�7�7�7��<�+� (�D�I�I�I�!)�D�I�I�I�
8�7��$�)�T�*�*�
/� �I�.��	��y�E�!�!�$��	��y��
�*�*�!�";�d�i�"G��N�N�N��{�$�"4�4�4�!�:�T�[�H�$�P�P�P�5�4rc�d�|jdkr�|j�td|���t|jtt
f��sKtdt
t|j�����d��dz|���dS|j�td|jz|���dS)Nrz/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�listr5�splitrs r�
_check_choicezOption._check_choice�s����9�� � ��|�#�!�E�t�M�M�M����u�d�m�<�<�
C�!�G��$�t�|�,�,�-�-�3�3�C�8�8��;�<�=A�C�C�C�
C�
C��\�
%��5��	�A�4�I�I�
I�&�
%rc���|j|jvp|jdu}|j�S|rS|jr0|jddd��dd��|_dS|jdd|_dSdSdS)NrrPrrCr%)r��
STORE_ACTIONSr�r�r�r�r�)rr�s  r�_check_destzOption._check_dest�s����{�d�&8�8�-��y��,�	��9������
3� �O�A�.�q�r�r�2�:�:�3��D�D��	�	�	� �,�Q�/��2��	�	�	����rc�d�|j|jvr|j�td|jz|���dSdS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�rrs r�_check_constzOption._check_const�sF���;�d�0�0�0�T�Z�5K��<�t�{�J����
�1�0�5K�5Krc��|j|jvr|j�	d|_dSdS|j�td|jz|���dS)Nr%z*'nargs' must not be supplied for action %r)r�rr�rrs r�_check_nargszOption._check_nargs�s\���;�$�,�,�,��z�!���
�
�
�"�!�
�Z�
#��<�t�{�J����
�$�
#rc��|jdkr�t|j��std|jz|���|j�2t|jt��std|jz|���|j�2t|jt��std|jz|���dSdS|j�td|jz|���|j�td|���|j�td|���dS)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�rr#r��dictrs r�_check_callbackzOption._check_callback�sQ���;�*�$�$��D�M�*�*�
G�!�/�$�-�?��G�G�G��"�.��t�1�5�9�9�/�!�I��(�)�*.�0�0�0��$�0��t�3�T�:�:�1�!�J��*�+�,0�2�2�2�1�0�0�0��}�(�!�D��m�$�%)�+�+�+��!�-�!�D�d�L�L�L��#�/�!�F��N�N�N�0�/rc�F�d�|j|jz��S)N�/)rJr�r�rs rr0zOption.__str__�s���x�x��(�4�?�:�;�;�;rc��|jduSr )r�rs rr�zOption.takes_value�s���y��$�$rc�D�|jr
|jdS|jdS�Nr)r�r�rs r�get_opt_stringzOption.get_opt_string�s'���?�	'��?�1�%�%��#�A�&�&rc�b�|j�|j��}|�|S||||��Sr )�TYPE_CHECKERr�r�)rr�r�rs    r�check_valuezOption.check_value�s8���#�'�'��	�2�2���?��L��7�4��e�,�,�,rc����|�=�jdkr���|��St��fd�|D����SdS)Nr%c�<��g|]}���|����Sr!)r;)r��vr�rs  ��rr�z(Option.convert_value.<locals>.<listcomp>s)���F�F�F�1�d�.�.�s�A�6�6�F�F�Fr)r�r;r#)rr�r�s`` r�
convert_valuezOption.convert_valuesY�������z�Q����'�'��U�3�3�3��F�F�F�F�F��F�F�F�G�G�G�	�rc�v�|�||��}|�|j|j||||��Sr )r?�take_actionr�r�)rr�r��valuesrRs     r�processzOption.processsG���"�"�3��.�.��
����K���C����@�@�	@rc�F�|dkrt|||���n�|dkrt|||j���ni|dkrt||d���nP|dkrt||d���n7|dkr+|�|g���|���n|dkr/|�|g���|j��n�|d	kr)t|||�|d
��dz��n�|dkr'|jpd
}|jpi}|j||||g|�Ri|��nu|dkr)|���|���nF|dkr)|�	��|���ntd|jz���dS)Nr�r�r�Tr�Fr�rrrr%r�r!r�rzunknown action %r)rr��ensure_valuer�r�r�r��
print_help�exit�
print_versionrXr�)	rr�r�r�r�rBrR�args�kwargss	         rrAzOption.take_actions����W����F�D�%�(�(�(�(�
�}�
$�
$��F�D�$�*�-�-�-�-�
�|�
#�
#��F�D�$�'�'�'�'�
�}�
$�
$��F�D�%�(�(�(�(�
�x�
�
�����b�)�)�0�0��7�7�7�7�
�~�
%�
%�����b�)�)�0�0���<�<�<�<�
�w�
�
��F�D�&�"5�"5�d�A�">�">��"B�C�C�C�C�
�z�
!�
!��%�+��D��)�/�R�F��D�M�$��U�F�D�T�D�D�D�V�D�D�D�D�
�v�
�
��������K�K�M�M�M�M�
�y�
 �
 �� � �"�"�"��K�K�M�M�M�M��0�4�;�>�?�?�?��qr)#rr1r2r:rrr(rrr+rr�rr:r	r.rrrrr r&r)r,r.r2r0r�__repr__r�r8r;r?rCrAr!rrrr�s���������*
�
�
�E�	�G��M�!�M�&��%�M�

D�E�$!.� -� -� -� ,�	��L� �M�
���&���,�,�,�*���&H�H�H�P�P�P�0I�I�I�
3�
3�
3�������N�N�N�8#� �"� �!�!�$�
&�M�<�<�<��H�%�%�%�'�'�'�-�-�-�H�H�H�
@�
@�
@�����rr�SUPPRESSHELP�
SUPPRESSUSAGEc�N�eZdZdd�Zd�ZeZd�Zd�Zd�Z	d�Z
d
d	�Zd
d
�Zd�Z
dS)rNc�d�|r+|���D]\}}t|||���dSdSr )�itemsr)rr�rr�s    rr.zValues.__init__9sP���	)�'�~�~�/�/�
)�
)���s���d�C�(�(�(�(�	)�	)�
)�
)rc�*�t|j��Sr )r5�__dict__rs rr0zValues.__str__>s���4�=�!�!�!rc��t|t��r|j|jkSt|t��r|j|kStSr )rrrRr1�NotImplemented)r�others  r�__eq__z
Values.__eq__CsH���e�V�$�$�	"��=�E�N�2�2�
��t�
$�
$�	"��=�E�)�)�!�!rc�h�t|��D]!}||vr||}|�t|||���"dS)z�
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        N)�dirr)rr1r�dvals    r�_update_carefulzValues._update_carefulKsN����I�I�	.�	.�D��t�|�|��D�z���#��D�$��-�-�-��		.�	.rc�:�|j�|��dS)z�
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        N)rR�update)rr1s  r�
_update_loosezValues._update_looseXs ��	
�
���T�"�"�"�"�"rc��|dkr|�|��dS|dkr|�|��dStd|z���)N�careful�loosezinvalid update mode: %r)rZr]rX)rr1�modes   r�_updatezValues._update`s^���9���� � ��&�&�&�&�&�
�W�_�_����t�$�$�$�$�$��6��=�>�>�>rr_c��t|��tj|}|�t	|��|��dSr )�
__import__�sys�modulesrb�vars)r�modnamera�mods    r�read_modulezValues.read_modulehs<���7�����k�'�"�����T�#�Y�Y��%�%�%�%�%rc��i}tt|�����|��|�||��dSr )�exec�open�readrb)r�filenamerargs    r�	read_filezValues.read_filemsC�����T�(�^�^�
 �
 �
"�
"�D�)�)�)����T�4� � � � � rc��t||��rt||���t|||��t||��Sr )�hasattr�getattrr)rrr�s   rrEzValues.ensure_valuersE���t�T�"�"�	'�g�d�D�&9�&9�&A��D�$��&�&�&��t�T�"�"�"rr )r_)rr1r2r.r0rrKrVrZr]rbrjrprEr!rrrr7s�������)�)�)�)�
"�"�"��H�"�"�"�.�.�.�#�#�#�?�?�?�&�&�&�&�
!�!�!�!�
#�#�#�#�#rrc�r�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�ZdS)ra�
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appear in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    c��|���||_|�|��|�|��dSr )�_create_option_list�option_class�set_conflict_handler�set_description)rrw�conflict_handlerr�s    rr.zOptionContainer.__init__�sM��
	
� � �"�"�"�(����!�!�"2�3�3�3����[�)�)�)�)�)rc�0�i|_i|_i|_dSr ��
_short_opt�	_long_optr�rs r�_create_option_mappingsz'OptionContainer._create_option_mappings�s����������
�
�
rc�N�|j|_|j|_|j|_dSr r|rhs  r�_share_option_mappingsz&OptionContainer._share_option_mappings�s%��!�+����)������
�
�
rc�@�|dvrtd|z���||_dS)N)�error�resolvez$invalid conflict_resolution value %r)rXrz)r�handlers  rrxz$OptionContainer.set_conflict_handler�s0���.�.�.��C�g�M�N�N�N� '����rc��||_dSr �r�r�s  rryzOptionContainer.set_description�s��&����rc��|jSr r�rs r�get_descriptionzOptionContainer.get_description�s����rc��|`|`|`dS�zsee OptionParser.destroy().Nr|rs r�destroyzOptionContainer.destroy�s���O��N��M�M�Mrc��g}|jD]-}||jvr"|�||j|f���.|jD]-}||jvr"|�||j|f���.|r�|j}|dkr0t
dd�d�|D����z|���|dkr�|D]�\}}|�d��r#|j�	|��|j|=n"|j�	|��|j|=|js&|js|j
j�	|����dSdSdS)Nr�z conflicting option string(s): %srIc��g|]
}|d��S)rr!)r��cos  rr�z3OptionContainer._check_conflict.<locals>.<listcomp>�s�� ?� ?� ?�2��A�� ?� ?� ?rr�r)r�r}r�r�r~rzrrJ�
startswith�remove�	containerr�)rr7�
conflict_optsr�r��c_options      r�_check_conflictzOptionContainer._check_conflict�s����
��%�	B�	B�C��d�o�%�%��$�$�c�4�?�3�+?�%@�A�A�A���$�	A�	A�C��d�n�$�$��$�$�c�4�>�#�+>�%?�@�@�@���	H��+�G��'�!�!�)�6��i�i� ?� ?�� ?� ?� ?�@�@�A������I�%�%�'4�H�H�O�S�(��~�~�d�+�+�1� �+�2�2�3�7�7�7� �N�3�/�/� �,�3�3�C�8�8�8� �O�C�0�$�0�H�H�4G�H� �*�6�=�=�h�G�G�G��!	H�	H�&�%�H�Hrc�J�t|dt��r|j|i|��}nTt|��dkr2|s0|d}t|t��std|z���ntd���|�|��|j�|��||_	|j
D]}||j|<�
|jD]}||j
|<�
|j�@|jt ur|j|j|j<n|j|jvrd|j|j<|S)zOadd_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        rr%znot an Option instance: %r�invalid argumentsN)rr5rwr�rrr�r�r�r�r�r}r�r~r�r�r�r�)rrIrJr7r�s     r�
add_optionzOptionContainer.add_option�sL���d�1�g�s�#�#�	1�&�T�&��7��7�7�F�F�
��Y�Y�!�^�^�F�^��!�W�F��f�f�-�-�
G�� <�v� E�F�F�F�
G��/�0�0�0����V�$�$�$������'�'�'�����%�	*�	*�C�#)�D�O�C� � ��$�	)�	)�C�"(�D�N�3����;�"��~�Z�/�/�-3�^��
�f�k�*�*���D�M�1�1�-1��
�f�k�*��
rc�:�|D]}|�|���dSr )r�)rr�r7s   r�add_optionszOptionContainer.add_optionss0��!�	$�	$�F��O�O�F�#�#�#�#�	$�	$rc�j�|j�|��p|j�|��Sr )r}r�r~rAs  r�
get_optionzOptionContainer.get_options2����#�#�G�,�,�,���"�"�7�+�+�	-rc�&�||jvp||jvSr )r}r~rAs  r�
has_optionzOptionContainer.has_options ���4�?�*�*��4�>�)�	+rc� �|j�|��}|�|j�|��}|�td|z���|jD]
}|j|=�|jD]
}|j|=�|jj�|��dS)Nzno such option %r)	r}r�r~rXr�r�r�r�r�)rr@r7r�s    r�
remove_optionzOptionContainer.remove_options�����$�$�W�-�-���>��^�'�'��0�0�F��>��0�7�:�;�;�;��%�	%�	%�C����$�$��$�	$�	$�C���s�#�#���$�+�+�F�3�3�3�3�3rc���|jsdSg}|jD]8}|jtur(|�|�|�����9d�|��S�Nrk)r�r�rr�r�rJ)r�	formatterr�r7s    r�format_option_helpz"OptionContainer.format_option_helpsg����	��2����&�	?�	?�F��;�-�/�/��
�
�i�5�5�f�=�=�>�>�>���w�w�v���rc�P�|�|�����Sr )r�r��rr�s  rr�z"OptionContainer.format_description(s"���+�+�D�,@�,@�,B�,B�C�C�Crc���g}|jr(|�|�|����|jr(|�|�|����d�|��S)Nr�)r�r�r�r�r�rJ�rr�r�s   r�format_helpzOptionContainer.format_help+so������	>��M�M�$�1�1�)�<�<�=�=�=���	>��M�M�$�1�1�)�<�<�=�=�=��y�y�� � � rN)rr1r2r:r.rr�rxryr�r�r�r�r�r�r�r�r�r�r�r!rrrrxs��������<	*�	*�	*����(�(�(�(�(�(�
'�'�'� � � ����H�H�H�6���<$�$�$�-�-�-�+�+�+�4�4�4� ���D�D�D�!�!�!�!�!rrc�.�eZdZdd�Zd�Zd�Zd�Zd�ZdS)rNc�p�||_t�||j|j|��||_dSr )rRrr.rwrz�title)rrRr�r�s    rr.zOptionGroup.__init__6s>������ � ��&�%�v�'>��	M�	M�	M���
�
�
rc�H�g|_|�|j��dSr )r�r�rRrs rrvzOptionGroup._create_option_list<s&������#�#�D�K�0�0�0�0�0rc��||_dSr )r�)rr�s  r�	set_titlezOptionGroup.set_title@s
����
�
�
rc�>�t�|��|`dSr�)rr�r�rs rr�zOptionGroup.destroyCs"������%�%�%����rc���|�|j��}|���|t�||��z
}|���|Sr )r�r�rvrr�rxr�s   rr�zOptionGroup.format_helpJsZ���)�)�$�*�5�5���������/�-�-�d�I�>�>�>���������
rr )rr1r2r.rvr�r�r�r!rrrr4sd����������1�1�1�����������rrc
��eZdZdZgZddedddddddf
d�Zd�Zd�Zd�Z	d	�Z
d+d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd,d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d-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*dS)/r	a$
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      description : string
        A paragraph of text giving a brief overview of your program.
        optparse reformats this paragraph to fit the current terminal
        width and prints it when the user requests help (after usage,
        but before the list of options).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    Nr�Tc�h�t�||||��|�|��|	|_||_d|_d|_|�t��}||_|j�	|��|
|_
|�||���|���dS)NT)�add_help)
rr.�	set_usage�progr�allow_interspersed_args�process_default_valuesrr�rir��_populate_option_list�_init_parsing_state)rr~r�rwrrzr�r��add_help_optionr�r�s           rr.zOptionParser.__init__�s���	� � ��,� 0�+�	?�	?�	?����u������	����'+��$�&*��#���-�/�/�I�"�����!�!�$�'�'�'����	
�"�"�;�,;�	#�	=�	=�	=�	
� � �"�"�"�"�"rc��t�|��|jD]}|����|`|`|`dS)a
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        N)rr�r�r�r�)rr�s  rr�zOptionParser.destroy�sN��	����%�%�%��'�	�	�E��M�M�O�O�O�O������N�N�Nrc�J�g|_g|_|���dSr )r�r�rrs rrvz OptionParser._create_option_list�s*���������$�$�&�&�&�&�&rc�R�|�dddtd�����dS)Nz-hz--helpr�zshow this help message and exit�r�r��r�rCrs r�_add_help_optionzOptionParser._add_help_option�s?������h�%��@�A�A�	�	C�	C�	C�	C�	Crc�P�|�ddtd�����dS)Nz	--versionrz&show program's version number and exitr�r�rs r�_add_version_optionz OptionParser._add_version_option�s=������(��G�H�H�	�	J�	J�	J�	J�	Jrc���|jr|�|j��|r|�|��|jr|���|r|���dSdSr )�standard_option_listr�rr�r�)rr�r�s   rr�z"OptionParser._populate_option_list�s����$�	8����T�6�7�7�7��	*����[�)�)�)��<�	'��$�$�&�&�&��	$��!�!�#�#�#�#�#�	$�	$rc�0�d|_d|_d|_dSr )�rargs�largsrBrs rr�z OptionParser._init_parsing_state�s����
���
�����rc���|�td��|_dS|tur	d|_dS|����d��r|dd�|_dS||_dS)Nz%prog [options]zusage: �)rCr~rr�r�r}s  rr�zOptionParser.set_usage�sm���=��,�-�-�D�J�J�J�
�n�
$�
$��D�J�J�J�
�[�[�]�]�
%�
%�i�
0�
0�	��q�r�r��D�J�J�J��D�J�J�Jrc��d|_dS)aSet parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args.TN�r�rs r�enable_interspersed_argsz%OptionParser.enable_interspersed_args�s��(,��$�$�$rc��d|_dS)z�Set parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        FNr�rs r�disable_interspersed_argsz&OptionParser.disable_interspersed_argss��(-��$�$�$rc��||_dSr )r�)rrCs  r�set_process_default_valuesz'OptionParser.set_process_default_valuess��&-��#�#�#rc��||j|<dSr )r�)rr�r�s   r�set_defaultzOptionParser.set_defaults��#��
�d���rc�:�|j�|��dSr )r�r\)rrJs  r�set_defaultszOptionParser.set_defaultss���
���V�$�$�$�$�$rc�l�|jdd�}|jD]}|�|j���|Sr )r�r�r�)r�optionsr�s   r�_get_all_optionszOptionParser._get_all_optionssB���"�1�1�1�%���'�	.�	.�E��N�N�5�,�-�-�-�-��rc�x�|jst|j��S|j���}|���D]c}|�|j��}t|t��r2|�	��}|�
||��||j<�dt|��Sr )r�rr��copyr�r�r�rr5r8r;)rr�r7r�r@s     r�get_default_valueszOptionParser.get_default_valuess����*�	)��$�-�(�(�(��=�%�%�'�'���+�+�-�-�	M�	M�F��l�l�6�;�/�/�G��'�3�'�'�
M� �/�/�1�1��(.�(:�(:�7�G�(L�(L����%���h���rc�j�t|dt��rt|g|�Ri|��}nlt|��dkrJ|sH|d}t|t��st	d|z���|j|urt
d���nt	d���|j�|��|S)Nrr%znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r�)	rr5rr�rrRrXr�r�)rrIrJr�s    r�add_option_groupzOptionParser.add_option_group+s����d�1�g�s�#�#�		1���6�t�6�6�6�v�6�6�E�E�
��Y�Y�!�^�^�F�^���G�E��e�[�1�1�
K�� A�E� I�J�J�J��|�4�'�'� �!E�F�F�F�(��/�0�0�0���!�!�%�(�(�(��rc��|j�|��p|j�|��}|r|j|ur|jSdSr )r}r�r~r�)rr@r7s   r�get_option_groupzOptionParser.get_option_group;sU���/�%�%�g�.�.�.��.�$�$�W�-�-�	��	$�f�&�d�2�2��#�#��trc�B�|�tjdd�S|dd�Sr$)re�argv)rrIs  r�	_get_argszOptionParser._get_argsEs$���<��8�A�B�B�<������7�Nrc�n�|�|��}|�|���}||_gx|_}||_	|�|||��}n@#ttf$r,}|�t|����Yd}~nd}~wwxYw||z}|�
||��S)aR
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is a Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        N)r�r�r�r�rB�
_process_argsrrr�r5�check_values)rrIrBr�r��stop�errs       r�
parse_argszOptionParser.parse_argsKs������t�$�$���>��,�,�.�.�F���
����
�U����	!��%�%�e�U�F�;�;�D�D��� 0�1�	!�	!�	!��J�J�s�3�x�x� � � � � � � � �����	!�����u�}��� � ���.�.�.s�A�B�-"B�Bc�
�||fS)a�
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        r!)rrBrIs   rr�zOptionParser.check_valuesrs����~�rc�6�|r�|d}|dkr|d=dS|dd�dkr|�||��nZ|dd�dkr*t|��dkr|�||��n"|jr|�|��|d=ndS|��dSdS)a�_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        rrNrPr%r)�_process_long_optr��_process_short_optsr�r�)rr�r�rB�args     rr�zOptionParser._process_argss����	���(�C��d�{�{��!�H����Q�q�S��T�!�!��&�&�u�f�5�5�5�5��R�a�R��C���C��H�H�q�L�L��(�(���7�7�7�7��-�
����S�!�!�!��!�H�H���'�	�	�	�	�	rc�,�t||j��S)a_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        )�
_match_abbrevr~)rr�s  r�_match_long_optzOptionParser._match_long_opt�s���S�$�.�1�1�1rc��|�d��}d|vr2|�dd��\}}|�d|��d}n|}d}|�|��}|j|}|���r~|j}t|��|kr+|�tdd|��||d�z��nc|dkr|�d��}	nGt|d|���}	|d|�=n*|r&|�td	��|z��nd}	|�||	||��dS)
Nrrrr%TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r7�numberz%s option does not take a value)
�popr%�insertr�r~r�r�r�r�rr#rCrC)
rr�rBr�r��next_arg�had_explicit_valuer7r�r�s
          rr�zOptionParser._process_long_opt�sv���i�i��l�l���#�:�:�!�i�i��Q�/�/�O�S�(��L�L��H�%�%�%�!%����C�!&���"�"�3�'�'�����$�������	��L�E��5�z�z�E�!�!��
�
�8�D�E����),�u�=�=�>�?�?�?�?��!����	�	�!������e�A�e�G�n�-�-���!�E�'�N�N�
�	��J�J�q�:�;�;�c�A�B�B�B�B��E����s�E�6�4�0�0�0�0�0rc��|�d��}d}d}|dd�D�]}d|z}|j�|��}|dz
}|st|���|���r�|t|��kr |�d||d���d}|j}	t|��|	kr+|�tdd|	��||	d�z��n;|	dkr|�d��}
nt|d|	���}
|d|	�=nd}
|�||
||��|rdS��dS)	NrFr%rTr�r�r�)r�r}r�rr�r�r�r�r�rr#rC)rr�rBr�r��i�chr�r7r�r�s           rr�z OptionParser._process_short_opts�s����i�i��l�l����
���a�b�b�'� 	� 	�B���(�C��_�(�(��-�-�F�
��F�A��
*�$�S�)�)�)��!�!�#�#�
��s�3�x�x�<�<��L�L��C����G�,�,�,��D�����u�:�:��%�%��J�J�x�H�I�� � �-0�5�!A�!A� B�C�C�C�C��a�Z�Z�!�I�I�a�L�L�E�E�!�%��%��.�1�1�E��a��g������N�N�3��v�t�4�4�4��
����
�? 	� 	rc�|�|j�/tj�tjd��S|jSr7)r�rU�path�basenamerer�rs r�
get_prog_namezOptionParser.get_prog_names.���9���7�#�#�C�H�Q�K�0�0�0��9�rc�R�|�d|�����S)Nz%prog)r�r)r�ss  r�expand_prog_namezOptionParser.expand_prog_names"���y�y��$�"4�"4�"6�"6�7�7�7rc�6�|�|j��Sr )rr�rs rr�zOptionParser.get_descriptions���$�$�T�%5�6�6�6rrc�p�|rtj�|��tj|��dSr )re�stderr�writerG)r�statusr,s   rrGzOptionParser.exits6���	"��J���S�!�!�!��������rc��|�tj��|�d|����d|�d���dS)z�error(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        rPz	: error: r�N)�print_usagererrGrr-s  rr�zOptionParser.errorsO��	
�����$�$�$��	�	�!�$�*<�*<�*>�*>�*>�*>����D�E�E�E�E�Erc�x�|jr2|j�|�|j����SdSr�)r~r�rrrs r�	get_usagezOptionParser.get_usage#s@���:�	��>�.�.��%�%�d�j�1�1�3�3�
3��2rc�^�|jr%t|���|���dSdS)aaprint_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        ��fileN)r~�printr�rrs  rr
zOptionParser.print_usage*s;���:�	/��$�.�.�"�"��.�.�.�.�.�.�	/�	/rc�H�|jr|�|j��SdSr�)rrrs r�get_versionzOptionParser.get_version6s'���<�	��(�(���6�6�6��2rc�^�|jr%t|���|���dSdS)aEprint_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        rN)rrrrs  rrHzOptionParser.print_version<s=���<�	1��$�"�"�$�$�4�0�0�0�0�0�0�	1�	1rc�X�|�|j}|�|��g}|�|�t	d������|���|jrC|�t�||����|�d��|j	D]?}|�|�
|����|�d���@|���d�|dd���S)N�Optionsr�rkr�)
r�r�r�r�rCrvr�rr�r�r�rxrJ)rr�r�r�s    rr�zOptionParser.format_option_helpGs������I��&�&�t�,�,�,����
�
�i�.�.�q��|�|�<�<�=�=�=���������	 ��M�M�/�<�<�T�9�M�M�N�N�N��M�M�$�����'�	 �	 �E��M�M�%�+�+�I�6�6�7�7�7��M�M�$������������w�w�v�c�r�c�{�#�#�#rc�6�|�|j��Sr )r�r�r�s  rr�zOptionParser.format_epilogXs���&�&�t�{�3�3�3rc��|�|j}g}|jr*|�|���dz��|jr+|�|�|��dz��|�|�|����|�|�|����d�|��Sr�)	r�r~r�rr�r�r�r�rJr�s   rr�zOptionParser.format_help[s�������I����:�	3��M�M�$�.�.�*�*�T�1�2�2�2���	E��M�M�$�1�1�)�<�<�t�C�D�D�D��
�
�d�-�-�i�8�8�9�9�9��
�
�d�(�(��3�3�4�4�4��w�w�v���rc�p�|�tj}|�|�����dS)z�print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        N)re�stdoutrr�rs  rrFzOptionParser.print_helpgs4���<��:�D��
�
�4�#�#�%�%�&�&�&�&�&r)T)NN)rNr )+rr1r2r:r�rr.r�rvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�rGr�rr
rrHr�r�r�rFr!rrr	r	Rs�������B�B�H���!�$��")�!��!%���#�#�#�#�D���$'�'�'�
C�C�C�
J�J�J�
$�$�$�$����	�	�	�,�,�,�-�-�-�.�.�.�$�$�$�%�%�%���� � � �"��� ������%/�%/�%/�%/�N������f2�2�2�"1�"1�"1�H$�$�$�R���8�8�8�7�7�7�����
F�F�F����
/�
/�
/�
/����	1�	1�	1�	1�$�$�$�$�"4�4�4�
�
�
�
�'�'�'�'�'�'rr	c�����|vr�S�fd�|���D��}t|��dkr|dS|st����|���t	�|���)z�_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    c�>��g|]}|�����|��Sr!)r�)r��wordrs  �rr�z!_match_abbrev.<locals>.<listcomp>�s9���0�0�0�$� �O�O�A�.�.�0��0�0�0rr%r)rr�r�sortrE)r�wordmaprGs`  rr�r�ts����	�G�|�|���0�0�0�0�'�,�,�.�.�0�0�0�
��}����"�"� ��#�#��	9� ��#�#�#�
��� � � �&�q�-�8�8�8r)'r:�__version__�__all__�
__copyright__rerUr�rrr�ImportErrorrC�	Exceptionr
rrrrrEr
rrr�r�r�r�r�r�rr�rrrrrrr	r�rr!rr�<module>r%s�����.������$�
�@������������J�J�J�	�)�)�)�)�)�)�)�)�)��������������	�����������Y���������=���� �����;����
�����
����6�6�6�6�6�m�6�6�6�
A�
A�
A�
A�
A�N�
A�
A�
A�M�M�M�M�M�M�M�M�^?�?�?�?�?�]�?�?�?�&G�G�G�G�G�=�G�G�G�&��� � � �%�a�a�	�l�l�3�%�q�q��|�|�4�!�1�1�%5�#6�#6�7�%�q�q��|�|�4�7�7��
G�G�G�%�%�%��
�n�n�n�n�n�n�n�n�f"�
�#��>#�>#�>#�>#�>#�>#�>#�>#�By!�y!�y!�y!�y!�y!�y!�y!�x�����?����<]'�]'�]'�]'�]'�O�]'�]'�]'�D9�9�9�:���s�$�2�2

Hacked By AnonymousFox1.0, Coded By AnonymousFox