AlkantarClanX12

Your IP : 18.119.142.210


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/optparse.cpython-310.opt-2.pyc

o

6��f���@s�	dZgd�ZdZddlZddlZddlZdd�Zz
ddlmZmZWne	y4dd	�Zd
d�ZYnweZ
Gdd
�d
e�ZGdd�de�Z
Gdd�de
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd�de�ZGdd�de�Zdd�Zd d!�Zee
d"�fee
d"�fee
d#�fee
d$�fd%�Zd&d'�Zd(d)�Zd*ZGd+d,�d,�Zd-Zd.ZGd/d0�d0�Z Gd1d2�d2�Z!Gd3d4�d4e!�Z"Gd5d6�d6e!�Z#d7d8�Z$eZ%dS)9z1.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.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r�//opt/alt/python310/lib64/python3.10/optparse.py�_reprO�r)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcC�
||_dSr��msg�rr%rrr�__init__h�
zOptParseError.__init__cC�|jSrr$rrrr�__str__k�zOptParseError.__str__N�r�
__module__�__qualname__r'r*rrrrrgsrc@�eZdZ	dd�Zdd�ZdS)r
cCs||_t|�|_dSr)r%�str�	option_id)rr%�optionrrrr'uszOptionError.__init__cCs|jrd|j|jfS|jS)Nz
option %s: %s)r1r%rrrrr*yszOptionError.__str__Nr,rrrrr
osr
c@�eZdZdS)rN�rr-r.rrrrr�rc@r3)rNr4rrrrr�r5rc@r/)rcCr#r)�opt_str�rr6rrrr'�r(zBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r6rrrrr*��zBadOptionError.__str__Nr,rrrrr�src@r/)�AmbiguousOptionErrorcCst�||�||_dSr)rr'�
possibilities)rr6r;rrrr'�s
zAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r8r6�joinr;rrrrr*�s�zAmbiguousOptionError.__str__Nr,rrrrr:�sr:c@s�eZdZ	dZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r	Znonec	Cs�d|_||_|dur%z	ttjd�}Wn
ttfy d}Ynw|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�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�rrBrLrHrPrrrr'�s(�
�
zHelpFormatter.__init__cCr#r)rA�rrArrr�
set_parser�r(zHelpFormatter.set_parsercC�&|dvr
td|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)rGrS�rZdelimrrr�set_short_opt_delimiter��
�z%HelpFormatter.set_short_opt_delimitercCrX)N)�=rZz.invalid metavar delimiter for long options: %rr[)rGrTr\rrr�set_long_opt_delimiter�r^z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr �rMrBrNrrrr�indent�szHelpFormatter.indentcCs"|j|j8_|jd8_dSr rarrrr�dedent�szHelpFormatter.dedentcC�td���Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage��zHelpFormatter.format_usagecCrdrerf�rZheadingrrr�format_headingrkzHelpFormatter.format_headingcCs0	t|j|jd�}d|j}tj||||d�S)N�rZ)Zinitial_indentZsubsequent_indent)rJrHrM�textwrapZfill)r�textZ
text_widthrbrrr�_format_texts
�zHelpFormatter._format_textcCs|r	|�|�dSdS�N�
rY�rq�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSrrrt)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdus|js|jS|jj�|j�}|tus|dur|j}|j�|jt	|��Sr)
rArQ�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer0)rr2Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|kr!d�jd|f}�j}nd�jd||f}d}|�|�|jr]��|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
krh|�d
�d�|�S)Nr?�%*s%s
rYz	%*s%-*s  rcsg|]
}d�jd|f�qS)r�rY)rK)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r!���rs)rRrKrM�len�appendrzr�roZwraprO�extendr=)rr2�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&




�

zHelpFormatter.format_optioncCs�|��d}|jD]}|�|�}||j|<t|t|�|j�}q	|��|jD]}|jD]}|�|�}||j|<t|t|�|j�}q,q'|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr?rn)rb�option_list�format_option_stringsrRrJr�rM�
option_groupsrcrIrLrKrHrO)rrAZmax_len�optZstrings�grouprrr�store_option_stringsKs"






�z"HelpFormatter.store_option_stringscsv	|��r$|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jr2||}n||}d�|�S)Nc�g|]	}�j|�f�qSr)rS)r�Zsopt��metavarrrrr�a��z7HelpFormatter.format_option_strings.<locals>.<listcomp>cr�r)rT)r�Zloptr�rrr�cr�r<)�takes_valuer�r}�upper�_short_opts�
_long_optsrPr=)rr2Z
short_optsZ	long_optsr�rr�rr�]s��

z#HelpFormatter.format_option_stringsN)rr-r.rr'rWr]r`rbrcrjrmrqrwryr�r�r�r�rrrrr	�s$)
#r	c@s0eZdZ					ddd�Zdd�Zd	d
�ZdS)r
r?�Nr!cC�t�|||||�dSr�r	r'rUrrrr't�
�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r8rhrrrrj|�z"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rY)rMrlrrrrm�z$IndentedHelpFormatter.format_heading)r?r�Nr!�rr-r.r'rjrmrrrrr
p�
�r
c@s0eZdZ					d
dd�Zdd�Zdd	�ZdS)rrr�NcCr�rr�rUrrrr'�r�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)rmr8rhrrrrj�rz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rNr�rlrrrrm�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�r�rcCsh|dd���dkr
d}n"|dd���dkr"d}|dd�p d}n
|dd�dkr-d}nd}|||�S)	Nr?Z0x�Z0b�0r!��
)�lower)�val�type�radixrrr�
_parse_num�s
r�cCs
t|t�Sr)r�rC)r�rrr�
_parse_int�r(r�Zintegerzfloating-point�complex)rC�long�floatr�cCs>t|j\}}z||�WStyttd�|||f��w)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�rGrr8)r2r��valueZcvtZwhatrrr�
check_builtin�s
��r�cCs6||jvr|Sd�tt|j��}ttd�|||f��)Nr<z.option %s: invalid choice: %r (choose from %s))�choicesr=�map�reprrr8)r2r�r�r�rrrr�s
��r)ZNOZDEFAULTc@s�eZdZ	gd�ZdZdZdZdZdZdZ	e
e
e
e
ed�Zd	Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeeeeeeegZ
d d!�ZeZd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Z d,d-�Z!d	S).r)�actionr�r}�default�nargs�constr��callback�
callback_args�callback_kwargsrzr�)
�store�store_const�
store_true�store_falser��append_const�countr�rz�version)r�r�r�r�r�r�r�)r�r�r�)r�r�)r�r�)�stringrCr�r�r��choice)rCr�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�qdSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr��attrs�checkerrrrr'4s




�zOption.__init__cCsdd�|D�}|s
td��|S)NcSsg|]}|r|�qSrr)r�r�rrrr�K�z-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rr�rrrr�GszOption._check_opt_stringscCs�|D]J}t|�dkrtd||��t|�dkr1|ddkr#|ddks*td||��|j�|�q|dd�dkr?|ddksFtd||��|j�|�qdS)	Nr?z>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�r
r�r�r�)rr�r�rrrr�Ps4�������zOption._set_opt_stringscCsv|jD]#}||vrt||||�||=q|dkr t||t�qt||d�q|r9t|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr<)�ATTRS�setattrr~�sorted�keysr
r=)rr��attrrrrr�es
��zOption._set_attrscCs4|jdur
d|_dS|j|jvrtd|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs


�zOption._check_actioncCs�|jdur|j|jvr|jdurd|_dSd|_dSdSt|jt�r'|jj|_|jdkr/d|_|j|jvr=td|j|��|j|jvrKtd|j|��dS)Nr�r�r0zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s"



�



��zOption._check_typecCsr|jdkr*|jdurtd|��t|jttf�s(tdtt|j���d�d|��dS|jdur7td|j|��dS)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�r
r��tuple�listr0�splitrrrr�
_check_choice�s$

����

��zOption._check_choicecCsf|j|jvp
|jdu}|jdur/|r1|jr%|jddd��dd�|_dS|jdd|_dSdSdS)Nrr?r�r8r!)r��
STORE_ACTIONSr�r}r�r�r�)rr�rrr�_check_dest�s� �zOption._check_destcCs.|j|jvr|jdurtd|j|��dSdS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s��zOption._check_constcCsB|j|jvr|jdurd|_dSdS|jdurtd|j|��dS)Nr!z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�
��zOption._check_nargscCs�|jdkr<t|j�std|j|��|jdur%t|jt�s%td|j|��|jdur8t|jt�s:td|j|��dSdS|jdurItd|j|��|jdurStd|��|jdur]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�r
r�r�r�r��dictrrrr�_check_callback�sP


�

���

����
��
�
��zOption._check_callbackcCsd�|j|j�S)N�/)r=r�r�rrrrr*�szOption.__str__cCs
|jduSr)r�rrrrr��r(zOption.takes_valuecCs|jr|jdS|jdS�Nr)r�r�rrrr�get_opt_string�s

zOption.get_opt_stringcCs&|j�|j�}|dur
|S||||�Sr)�TYPE_CHECKERr|r�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dur�jdkr���|�St��fdd�|D��SdS)Nr!csg|]}���|��qSr)r�)r��v�r�rrrr�sz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values

�zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�r})rr�r��valuesrArrr�processs�zOption.processc	CsH|dkrt|||�dS|dkrt|||j�dS|dkr%t||d�dS|dkr1t||d�dS|dkr@|�|g��|�dS|dkrP|�|g��|j�dS|d	krbt|||�|d
�d�dS|dkr�|jpjd
}|jpoi}|j||||g|�Ri|��dS|dkr�|��|��dS|dkr�|�	�|��dSt
d|j��)Nr�r�r�Tr�Fr�r�r�rr!r�rrzr�zunknown action %r)r�r��ensure_valuer�r�r�r��
print_help�exit�
print_versionrGr�)	rr�r}r�r�r�rA�args�kwargsrrrr�sF�������


���zOption.take_action)"rr-r.r�r�r�r�r�r�r�r�rr�r�r'r�r�r�r�r�r�r�r�r�r�r*r�__repr__r�r�r�r�r�r�rrrrr�sV
�	
	�	rZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs*|r|��D]\}}t|||�qdSdSr)�itemsr�)rr{r�r�rrrr'9s
�zValues.__init__cCs
t|j�Sr)r0�__dict__rrrrr*>r(zValues.__str__cCs.t|t�r|j|jkSt|t�r|j|kStSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs8	t|�D]}||vr||}|durt|||�qdSr)�dirr�)rr�r�Zdvalrrr�_update_carefulKs��zValues._update_carefulcCs	|j�|�dSr)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�dS|dkr|�|�dStd|��)N�carefulZloosezinvalid update mode: %r)rrrG)rr��moderrr�_update`s
zValues._updatercCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr�vars)r�modnamer�modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr)r�filenamerr
rrr�	read_filemszValues.read_filecCs.t||�rt||�durt|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rs
zValues.ensure_valuer)r)rr-r.r'r*rr�r�rrrr
rr�rrrrr7s



rc@s�eZdZ	dd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"rcCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrvrrrr'�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optr{rrrr�_create_option_mappings�s
z'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrVrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dvr
td|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)rGr)r�handlerrrrr�s
z$OptionContainer.set_conflict_handlercCr#r�rvrurrrr�r(zOptionContainer.set_descriptioncCr)rr"rrrr�get_description�r+zOptionContainer.get_descriptioncCs	|`|`|`dSrrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]}||jvr|�||j|f�q|jD]}||jvr+|�||j|f�q|rv|j}|dkrDtdd�dd�|D��|��|dkrx|D]/\}}|�d�r^|j�	|�|j|=n
|j�	|�|j|=|jsu|jsu|j
j�	|�qJdSdSdS)Nrz conflicting option string(s): %sr<cSsg|]}|d�qS)rr)r��corrrr��r�z3OptionContainer._check_conflict.<locals>.<listcomp>r r�)r�rr�r�rrrr=�
startswith�remove�	containerr�)rr2Z
conflict_optsr�r!Zc_optionrrr�_check_conflict�s>

�

���

��zOptionContainer._check_conflictcOs�	t|dt�r|j|i|��}nt|�dkr)|s)|d}t|t�s(td|��ntd��|�|�|j�|�||_	|j
D]}||j|<q>|jD]}||j
|<qI|jdurp|jturd|j|j|j<|S|j|jvrpd|j|j<|S)Nrr!znot an Option instance: %r�invalid arguments)r�r0rr�rr�r)r�r�r(r�rr�rr}r�r~r{)rr�r�r2r�rrr�
add_option�s.
�




�zOptionContainer.add_optioncCs|D]}|�|�qdSr)r+)rr�r2rrr�add_optionss�zOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rr|rr7rrr�
get_options
�zOptionContainer.get_optioncCs||jvp	||jvSr)rrr7rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dur|j�|�}|durtd|��|jD]}|j|=q|jD]}|j|=q'|jj�|�dS)Nzno such option %r)	rr|rrGr�r�r(r�r')rr6r2r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|jsdSg}|jD]}|jtur|�|�|��q
d�|�S�NrY)r�rzrr�r�r=)r�	formatterr�r2rrr�format_option_helps

�
z"OptionContainer.format_option_helpcCs|�|���Sr)rwr#�rr1rrrrw(r9z"OptionContainer.format_descriptioncCs:g}|jr
|�|�|��|jr|�|�|��d�|�S)Nrs)rvr�rwr�r2r=�rr1r�rrr�format_help+s
zOptionContainer.format_helpN)rr-r.r'rrrrr#r$r)r+r,r-r.r/r2rwr5rrrrrxs$			rc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)rArr'rr�title)rrAr6rvrrrr'6s
�
zOptionGroup.__init__cCsg|_|�|j�dSr)r�rrArrrrr<szOptionGroup._create_option_listcCr#r)r6)rr6rrr�	set_title@r(zOptionGroup.set_titlecCs	t�|�|`dSr)rr$r�rrrrr$Cs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)rmr6rbrr5rcr4rrrr5Js
zOptionGroup.format_helpr)rr-r.r'rr7r$r5rrrrr4s
rc
@s`eZdZ	gZddedddddddf
dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dOdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdPd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdQd;d<�Z d=d>�Z!d?d@�Z"dRdAdB�Z#dCdD�Z$dRdEdF�Z%dRdGdH�Z&dIdJ�Z'dRdKdL�Z(dRdMdN�Z)dS)SrNrTcCsrt�||||�|�|�|	|_||_d|_d|_|dur t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr'�	set_usage�progr��allow_interspersed_args�process_default_valuesr
r1rWrx�_populate_option_list�_init_parsing_state)rrir�rr�rrvr1Zadd_help_optionr:rxrrrr'�s"�
�zOptionParser.__init__cCs0	t�|�|jD]}|��q	|`|`|`dSr)rr$r�r�r1)rr�rrrr$�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�rrrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprzzshow this help message and exit�r�rz�r+r8rrrr�_add_help_option�s
�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr?r@rrrr�_add_version_option�s
�z OptionParser._add_version_optioncCsB|jr	|�|j�|r|�|�|jr|��|r|��dSdSr)�standard_option_listr,r�rBrA)rr�r8rrrr=�s
�z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr>�s
z OptionParser._init_parsing_statecCsR|durtd�|_dS|turd|_dS|���d�r$|dd�|_dS||_dS)Nz%prog [options]zusage: �)r8rirr�r&rhrrrr9�s

zOptionParser.set_usagecC�	d|_dS)NT�r;rrrr�enable_interspersed_args��
z%OptionParser.enable_interspersed_argscCrG)NFrHrrrr�disable_interspersed_argsrJz&OptionParser.disable_interspersed_argscCr#r)r<)rr�rrr�set_process_default_valuesr(z'OptionParser.set_process_default_valuescCs||j|<dSr)r{)rr}r�rrr�set_defaultr9zOptionParser.set_defaultcKs|j�|�dSr)r{r)rr�rrr�set_defaultsr�zOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q
|Sr)r�r�r�)rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]}|�|j�}t|t�r+|�	�}|�
||�||j<qt|�Sr)r<rr{�copyrOr|r}r�r0r�r�)rr{r2r�r6rrr�get_default_valuess


�zOptionParser.get_default_valuescOs�t|dt�rt|g|�Ri|��}n%t|�dkr4|s4|d}t|t�s*td|��|j|ur3td��ntd��|j�|�|S)Nrr!znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r*)	r�r0rr�r�rArGr�r�)rr�r�r�rrr�add_option_group+s

�zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r|j|ur|jSdSr)rr|rr()rr6r2rrr�get_option_group;s
�zOptionParser.get_option_groupcCs"|durtjdd�S|dd�Sr )r�argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�	|�|�}|dur|��}||_g|_}||_z	|�|||�}Wnttfy=}z
|�t	|��WYd}~nd}~ww||}|�
||�Sr)rUrQrDrEr��
_process_argsrrrr0�check_values)rr�r�rDrE�stop�errrrr�
parse_argsKs


��zOptionParser.parse_argscCs
	||fSrr)rr�r�rrrrWrs
zOptionParser.check_valuescCs�	|rF|d}|dkr|d=dS|dd�dkr|�||�n#|dd�dkr4t|�dkr4|�||�n|jr@|�|�|d=ndS|sdSdS)Nrr�r?r!r�)�_process_long_optr��_process_short_optsr;r�)rrErDr��argrrrrVs	
�zOptionParser._process_argscCs	t||j�Sr)�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|vr|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r\|j}t|�|krD|�t	dd|�||d��n&|dkrN|�d�}	nt
|d|��}	|d|�=n|rh|�td	�|�nd}	|�||	||�dS)
Nrr_r!TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r2Znumberz%s option does not take a value)
�popr��insertr_rr�r�r�rrr�r8r�)
rrDr�r]r�Znext_argZhad_explicit_valuer2r�r�rrrr[�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]k}d|}|j�|�}|d7}|s%t|��|��rk|t|�kr;|�d||d��d}|j}	t|�|	krS|�t	dd|	�||	d��n|	dkr]|�d�}
nt
|d|	��}
|d|	�=nd}
|�||
||�|rzdSqdS)	NrFr!r�Tr`rarb)rcrr|rr�r�rdr�rrr�r�)rrDr�r]rX�iZchr�r2r�r�rrrr\�s@
����z OptionParser._process_short_optscCs"|jdurtj�tjd�S|jSr�)r:rD�path�basenamerrTrrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)r�rh)r�srrr�expand_prog_namer�zOptionParser.expand_prog_namecCs|�|j�Sr)rjrvrrrrr#r�zOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r�stderr�writer�)rZstatusr%rrrr�szOptionParser.exitcCs*	|�tj�|�dd|��|f�dS)Nr?z%s: error: %s
)�print_usagerrkr�rhr&rrrrszOptionParser.errorcCs|jr
|j�|�|j��SdSr0)rir1rjrjrrrr�	get_usage#s

�zOptionParser.get_usagecC� 	|jrt|��|d�dSdS�N)�file)ri�printrn�rrqrrrrm*s�zOptionParser.print_usagecCs|jr	|�|j�SdSr0)r�rjrrrr�get_version6szOptionParser.get_versioncCrorp)r�rrrtrsrrrr�<s�zOptionParser.print_versioncCs�|dur|j}|�|�g}|�|�td���|��|jr-|�t�||��|�d�|j	D]}|�|�
|��|�d�q0|��d�|dd��S)NZOptionsrsrYr�)
r1r�r�rmr8rbr�rr2r�r5rcr=)rr1r�r�rrrr2Gs


zOptionParser.format_option_helpcCs|�|j�Sr)ryrxr3rrrryXr�zOptionParser.format_epilogcCsn|dur|j}g}|jr|�|��d�|jr"|�|�|�d�|�|�|��|�|�|��d�|�Srr)	r1rir�rnrvrwr2ryr=r4rrrr5[s
zOptionParser.format_helpcCs"	|durtj}|�|���dSr)r�stdoutrlr5rsrrrr�gszOptionParser.print_help)T)NN)rNr)*rr-r.rCrr'r$rrArBr=r>r9rIrKrLrMrNrOrQrRrSrUrZrWrVr_r[r\rhrjr#r�rrnrmrtr�r2ryr5r�rrrrrRsdD
�"

	

'
3	$)





rcsV	�|vr�S�fdd�|��D�}t|�dkr|dS|s"t���|��t�|��)Ncsg|]	}|���r|�qSr)r&)r�Zword�rirrr��s
�z!_match_abbrev.<locals>.<listcomp>r!r)r�r�r�sortr:)riZwordmapr;rrvrr^ts
r^)&�__version__�__all__Z
__copyright__rrDrorrr�ImportErrorr8�	Exceptionrr
rrrr:r	r
rr�r�r�r�r�r�rr~rrrrrrrr^rrrrr�<module>sd 
�	

P



�uA=&