Your IP : 3.148.105.127


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/argparse.cpython-39.opt-2.pyc

a

R�fG�@sdZgd�ZddlZddlZddlZddlmZ	m
Z
dZdZdZ
dZd	Zd
ZdZGdd
�d
e�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZGd$d%�d%e�Z Gd&d'�d'e�Z!Gd(d)�d)e!�Z"Gd*d+�d+e!�Z#Gd,d-�d-e�Z$Gd.d/�d/e�Z%Gd0d1�d1e�Z&Gd2d3�d3e�Z'Gd4d5�d5e�Z(Gd6d7�d7e�Z)Gd8d9�d9e$�Z*Gd:d;�d;e�Z+Gd<d=�d=e�Z,Gd>d?�d?e�Z-Gd@dA�dAe-�Z.GdBdC�dCe.�Z/GdDdE�dEee-�Z0dS)Fz1.1)�ArgumentParser�
ArgumentError�ArgumentTypeError�BooleanOptionalAction�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s$eZdZdd�Zdd�Zdd�ZdS)�_AttributeHoldercCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r+�-/opt/alt/python39/lib64/python3.9/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�list�__dict__�items�r&r+r+r,r#�sz_AttributeHolder._get_kwargscCsgSr.r+r2r+r+r,r �sz_AttributeHolder._get_argsN)r�
__module__�__qualname__r-r#r r+r+r+r,rks	rcCs6|durgSt|�tur$|dd�Sddl}|�|�S�Nr)rr/�copy)r1r6r+r+r,�_copy_items�sr7c@s�eZdZd:dd�Zdd�Zdd	�ZGd
d�de�Zdd
�Zdd�Z	dd�Z
dd�Zd;dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)<r��NcCs�|dur"ddl}|��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nrr8�z\s+z\n\n\n+)�shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r&�progZindent_incrementZmax_help_position�widthr;r+r+r,�__init__�s"
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N��rDr?rEr2r+r+r,�_indent�szHelpFormatter._indentcCs"|j|j8_|jd8_dSrRrTr2r+r+r,�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr.)�	formatter�parent�headingr1)r&rWrXrYr+r+r,rQ�szHelpFormatter._Section.__init__cCs�|jdur|j��|jj}|dd�|jD��}|jdurD|j��|sLdS|jturz|jdurz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr+r+)�.0�func�argsr+r+r,�
<listcomp>��z6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rXrWrU�_join_partsr1rVrYrrD)r&r%Z	item_helpZcurrent_indentrYr+r+r,�format_help�s



z"HelpFormatter._Section.format_help)N)rr3r4rQrbr+r+r+r,rG�s
rGcCs|jj�||f�dSr.)rIr1r!)r&r[r\r+r+r,�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr.)rUrGrIrcrb)r&rYZsectionr+r+r,�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr.)rIrXrVr2r+r+r,�end_section�s
zHelpFormatter.end_sectioncCs$|tur |dur |�|j|g�dSr.)rrc�_format_text)r&�textr+r+r,�add_text�szHelpFormatter.add_textcCs&|tur"||||f}|�|j|�dSr.)rrc�
_format_usage)r&�usage�actions�groups�prefixr\r+r+r,�	add_usage�szHelpFormatter.add_usagecCsr|jturn|j}||�g}|�|�D]}|�||��q$ttt|��}||j}t|j	|�|_	|�
|j|g�dSr.)�helpr�_format_action_invocation�_iter_indented_subactionsr!rA�map�lenrDrFrc�_format_action)r&�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr+r+r,�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr.)rw)r&rkrur+r+r,�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r`)rHrbrN�sub�strip)r&ror+r+r,rbs

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr_cSsg|]}|r|tur|�qSr+)r)rZ�partr+r+r,r]"s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r%)r&Zpart_stringsr+r+r,ra!s
�zHelpFormatter._join_partscs|durtd�}|dur,|t|jd�}�n�|durL|sLdt|jd�}�n�|du�rdt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�rd}|	||�}|	||�}
t
�||�}t
�||
�}d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r|||g|||�}|�|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�r�g}|�|||��|�|||��|g|}d�|�}d
||fS)Nzusage: �rOz%(prog)s� cSsg|]}|r|�qSr+r+)rZ�sr+r+r,r]Br^z/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|durt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dur�|dt|�d�|d<|S)NrSr~r)rsr!r%)�parts�indentrm�lines�lineZline_lenr|��
text_widthr+r,�	get_linesVs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rSr`z%s%s

)N)
�_�dictr>�option_stringsr!�_format_actions_usager%rCrDrsrJ�findall�extend)r&rjrkrlrmrO�	optionals�positionalsru�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�r�r+r�r,ri&sX
�




zHelpFormatter._format_usagec	Cst�}i}|D�]*}|js(td|����z|�|jd�}WntyRYqYq0|t|j�}|||�|jkr|jD]}|�|�qz|js�||vr�||d7<nd||<||vr�||d7<nd||<nF||vr�||d7<nd||<||v�r||d7<nd||<t|d	|�D]}	d
||	<�q*qg}
t|�D�]"\}	}|j	t
u�r�|
�d�|�|	�d
k�r�|�
|	�n"|�|	d	�d
k�rj|�
|	d	�n�|j�s|�|�}|�||�}||v�r�|ddk�r�|ddk�r�|d	d�}|
�|�nf|jd}
|jdk�r$|��}n"|�|�}|�||�}d|
|f}|j�s`||v�r`d
|}|
�|��qHt|dd�D]}	||	g|
|	|	�<�qzd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nzempty group rz [�[�]z (�(�)rS�|����%s %s�[%s]T)�reverser~cSsg|]}|dur|�qSr.r+)rZ�itemr+r+r,r]�r^z7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr_z\(([^|]*)\))�set�_group_actions�
ValueError�indexrs�add�required�range�	enumeraterorr!�get�popr��#_get_default_metavar_for_positional�_format_args�nargs�format_usage�!_get_default_metavar_for_optional�sortedr%rJrzr{)r&rkrl�
group_actionsZinserts�group�start�endru�ir��defaultr|�
option_string�args_stringrg�open�closer+r+r,r��s~










z#HelpFormatter._format_actions_usagecCsFd|vr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r}�r~ry)r�r>rArCrD�
_fill_text)r&rgr�r�r+r+r,rf�s

zHelpFormatter._format_textc
CsNt|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|j�r|j�	��r|�
|�}	|	�r"|�|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�
d��s"|�d�|�|�D]}|�|�|���q,|�|�S)	Nr8r�r_z%*s%s
z	%*s%-*s  rrSr`)r@rFrBrArCrDrprorsr{�_expand_help�_split_linesr!�endswithrqrtra)
r&ruZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstr�Z	help_textZ
help_linesr�rvr+r+r,rt�s:
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrSrr�r)	r�r��_metavar_formatterr�r�r�r�r!r%)r&rur��metavarr�r�r�r+r+r,rp's



z'HelpFormatter._format_action_invocationcsP|jdur|j�n.|jdur<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr+��str)rZZchoicer+r+r,r]Cr^z4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr.)�
isinstance�tuple)Z
tuple_size��resultr+r,r�Hs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr%)r&ru�default_metavarZchoice_strsr�r+r�r,r�?s

z HelpFormatter._metavar_formattercCs|�||�}|jdur$d|d�}n�|jtkr<d|d�}n�|jtkrn|d�}t|�dkrdd|}nd|}n�|jtkr�d|d�}n�|jtkr�d}nr|jtkr�d	|d�}nZ|jtkr�d
}nJzdd�t	|j�D�}Wnt
y�td
�d�Yn0d�|�||j�}|S)N�%srSr�r8z
[%s [%s ...]]z[%s ...]z%s [%s ...]rz%s ...r_cSsg|]}d�qS)r�r+)rZr�r+r+r,r]er^z.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer~)
r�r�rrrsr
rrrr��	TypeErrorr�r%)r&rur�Zget_metavarr�r�Zformatsr+r+r,r�Os0








zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tur||=qt|�D] }t||d�r:||j||<q:|�d�dur�d�dd�|dD��}||d<|�	|�|S)Nr}rr�rcSsg|]}t|��qSr+r��rZ�cr+r+r,r]tr^z.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr>r/r�hasattrrr�r%�_get_help_string)r&ru�paramsr)Zchoices_strr+r+r,r�kszHelpFormatter._expand_helpccs>z
|j}WntyYn0|��|�EdH|��dSr.)�_get_subactions�AttributeErrorrUrV)r&ruZget_subactionsr+r+r,rqxs
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nr~r)rMrzr{�textwrapZwrap)r&rgrPr�r+r+r,r��szHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nr~r)Zinitial_indentZsubsequent_indent)rMrzr{r�Zfill)r&rgrPr�r�r+r+r,r��s�zHelpFormatter._fill_textcCs|jSr.)ro�r&rur+r+r,r��szHelpFormatter._get_help_stringcCs
|j��Sr.)�dest�upperr�r+r+r,r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr.)r�r�r+r+r,r��sz1HelpFormatter._get_default_metavar_for_positional)r8r9N)N)rr3r4rQrUrV�objectrGrcrdrerhrnrwrxrbrarir�rfrtrpr�r�r�rqr�r�r�r�r�r+r+r+r,r�s<	�

`j0

rc@seZdZdd�ZdS)rcs d��fdd�|jdd�D��S)Nr_c3s|]}�|VqdSr.r+)rZr��r�r+r,�	<genexpr>�r^z9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r%�
splitlines)r&rgrPr�r+r�r,r��sz&RawDescriptionHelpFormatter._fill_textN)rr3r4r�r+r+r+r,r�src@seZdZdd�ZdS)r	cCs|��Sr.)r�)r&rgrPr+r+r,r��sz!RawTextHelpFormatter._split_linesN)rr3r4r�r+r+r+r,r	�sr	c@seZdZdd�ZdS)rcCs>|j}d|jvr:|jtur:ttg}|js2|j|vr:|d7}|S)Nz
%(default)� (default: %(default)s))ror�rrrr�r�)r&ruroZdefaulting_nargsr+r+r,r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr3r4r�r+r+r+r,r�src@seZdZdd�Zdd�ZdS)r
cCs|jjSr.�rrr�r+r+r,r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr.r�r�r+r+r,r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr3r4r�r�r+r+r+r,r
�sr
cCsh|durdS|jrd�|j�S|jdtfvr2|jS|jdtfvrF|jS|jr`dd�|j�dSdSdS)N�/�{r��})r�r%r�rr�r�)�argumentr+r+r,�_get_action_name�sr�c@seZdZdd�Zdd�ZdS)rcCst|�|_||_dSr.)r��
argument_name�message)r&r�r�r+r+r,rQ�s
zArgumentError.__init__cCs(|jdurd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r&r�r+r+r,�__str__�s
�zArgumentError.__str__N)rr3r4rQr�r+r+r+r,r�src@seZdZdS)rN)rr3r4r+r+r+r,r�src@s0eZdZddd�Zdd�Zdd�Zdd	d
�ZdS)
rNFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr.�
r�r�r��constr�rr�r�ror��r&r�r�r�r�r�rr�r�ror�r+r+r,rQ4szAction.__init__csgd�}�fdd�|D�S)Nr�csg|]}|t�|�f�qSr+��getattr�rZr)r2r+r,r]Wr^z&Action._get_kwargs.<locals>.<listcomp>r+�r&�namesr+r2r,r#JszAction._get_kwargscCs
|jdSr5�r�r2r+r+r,r�YszAction.format_usagecCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r&�parser�	namespace�valuesr�r+r+r,�__call__\szAction.__call__)NNNNNFNN)N)rr3r4rQr#r�r�r+r+r+r,rs6�
rcs0eZdZd	�fdd�	Zd
dd�Zdd�Z�ZS)rNFc	s~g}	|D]2}
|	�|
�|
�d�rd|
dd�}
|	�|
�q|dur\|dur\|tur\|d7}t�j|	|d||||||d�	dS)N�--�--no-r8r�r)	r�r�r�r�rr�r�ror�)r!�
startswithr�superrQ)r&r�r�r�rr�r�ror�Z_option_stringsr���	__class__r+r,rQ`s&


�zBooleanOptionalAction.__init__cCs$||jvr t||j|�d��dS)Nr�)r��setattrr�r�r�r+r+r,r��s
zBooleanOptionalAction.__call__cCsd�|j�S)Nz | )r%r�r2r+r+r,r��sz"BooleanOptionalAction.format_usage)NNNFNN)N)rr3r4rQr�r��
__classcell__r+r+r�r,r_s� 
rcs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dur,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�rr�r�rQr�r�r+r,rQ�s 
�z_StoreAction.__init__cCst||j|�dSr.)r�r�r�r+r+r,r��sz_StoreAction.__call__)NNNNNFNN)N�rr3r4rQr�r�r+r+r�r,r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�ro)r�r�rQ�r&r�r�r�r�r�ror�r�r+r,rQ�s
�z_StoreConstAction.__init__cCst||j|j�dSr.)r�r�r�r�r+r+r,r��sz_StoreConstAction.__call__)NFNN)Nr�r+r+r�r,r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�ro)r�r�rQ�r&r�r�r�r�ror�r+r,rQ�s
�z_StoreTrueAction.__init__)FFN�rr3r4rQr�r+r+r�r,r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr)r�rrQrr�r+r,rQ�s
�z_StoreFalseAction.__init__)TFNrr+r+r�r,r�s�rcs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dur,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�rr�rrQr�r�r+r,rQ�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr.)r�r�r7r!r��r&r�r�r�r�r1r+r+r,r�s
z_AppendAction.__call__)NNNNNFNN)Nr�r+r+r�r,r�s�rcs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�ror�)r�rrQr�r�r+r,rQs
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr.)r�r�r7r!r�r�rr+r+r,r�sz_AppendConstAction.__call__)NFNN)Nr�r+r+r�r,r
s�rcs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�ro)r�rrQrr�r+r,rQ's
�z_CountAction.__init__cCs0t||jd�}|durd}t||j|d�dS�NrrS)r�r�r�)r&r�r�r�r��countr+r+r,r�5sz_CountAction.__call__)NFN)Nr�r+r+r�r,r%s
�rcs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�ro)r�r
rQ)r&r�r�r�ror�r+r,rQ>s
�z_HelpAction.__init__cCs|��|��dSr.)�
print_help�exitr�r+r+r,r�Jsz_HelpAction.__call__)N�rr3r4rrQr�r�r+r+r�r,r
<s
�r
cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr)r�rrQ�version)r&r�rr�r�ror�r+r,rQQs
�z_VersionAction.__init__cCsD|j}|dur|j}|��}|�|�|�|��tj�|��dSr.)r�_get_formatterrh�_print_messagerb�_sys�stdoutr
)r&r�r�r�r�rrWr+r+r,r�_s
z_VersionAction.__call__)Nrr+r+r�r,rOs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�ror�)r%r�r�_ChoicesPseudoActionrQ)r&r)�aliasesror�r�Zsupr�r+r,rQms
�z/_SubParsersAction._ChoicesPseudoAction.__init__rr+r+r�r,rksrFNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�ror�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�rrQr)r&r�rO�parser_classr�r�ror�r�r+r,rQus	
�z_SubParsersAction.__init__cKs�|�d�dur d|j|f|d<|�dd�}d|vrX|�d�}|�|||�}|j�|�|jfi|��}||j|<|D]}||j|<qv|S)NrOr�rr+ro)r�rr�rrr!rr)r&r)�kwargsrroZ
choice_actionr��aliasr+r+r,�
add_parser�s

z_SubParsersAction.add_parsercCs|jSr.)rr2r+r+r,r��sz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtur,t||j|�z|j|}Wn:tyt|d�|j�d�}td�|}t||��Yn0|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrSr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr%r�r�parse_known_argsr�r1�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r&r�r�r�r�r r'r\�msgZsubnamespace�keyr*r+r+r,r��s$

�	z_SubParsersAction.__call__)N)rr3r4rrrrQrr�r�r�r+r+r�r,ris�rc@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr.)r�r�r7r�r�rr+r+r,r��s
z_ExtendAction.__call__)N)rr3r4r�r+r+r+r,r'�sr'c@s&eZdZd
dd�Zdd�Zdd	�ZdS)r�rr�NcCs||_||_||_||_dSr.)�_mode�_bufsize�	_encoding�_errors)r&�mode�bufsize�encoding�errorsr+r+r,rQ�szFileType.__init__c
s�|dkrnd�jvr*d�jvr$tjjStjSt�fdd�dD��rXd�jvrRtjjStjStd��j}t|��zt|�j�j	�j
�j�WSty�}z*||d�}td	�}t
||��WYd}~n
d}~00dS)
N�-r(�bc3s|]}|�jvVqdSr.)r)r�r2r+r,r��r^z$FileType.__call__.<locals>.<genexpr>Zwaxzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)r)r�stdin�buffer�anyrr�r�r�r*r+r,�OSErrorr)r&�stringr%�er\r�r+r2r,r��s
�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr/r0rcSsg|]}|dkrt|��qS)r�)r")rZr(r+r+r,r]�r^z%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|durd||f�qS)Nrr+)rZ�kwr(r+r+r,r]s�r)r)r*r+r,r%rr)r&r\rZargs_strr+r+r,r-�s�zFileType.__repr__)r(r�NN)rr3r4rQr�r-r+r+r+r,r�s
rc@s$eZdZdd�Zdd�Zdd�ZdS)rcKs|D]}t||||�qdSr.)r�)r&rr)r+r+r,rQszNamespace.__init__cCst|t�stSt|�t|�kSr.)r�r�NotImplementedr�)r&�otherr+r+r,�__eq__s
zNamespace.__eq__cCs
||jvSr.)r0)r&r&r+r+r,�__contains__szNamespace.__contains__N)rr3r4rQr>r?r+r+r+r,rsrcs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NruZstoreZstore_const�
store_trueZstore_falser!Zappend_constr	ror�parsersr�z^-\d+$|^-\d*\.\d+$)r�r@rQ�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�rrrrr
rrr'�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrJrK�_negative_number_matcher�_has_negative_number_optionals)r&rCrErDrFr�r+r,rQs4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr.)rGr#)r&�
registry_namer*r��registryr+r+r,rHSsz_ActionsContainer.registerNcCs|j|�||�Sr.)rGr�)r&rQr*r�r+r+r,�
_registry_getWsz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|vr||j|_qdSr.)rN�updaterJr�r�)r&rrur+r+r,�set_defaults]s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdur|jSq|j�|d�Sr.)rJr�r�rNr�)r&r�rur+r+r,�get_defaultfs
z_ActionsContainer.get_defaultcOsP|j}|r&t|�dkrL|dd|vrL|r:d|vr:td��|j|i|��}n|j|i|��}d|vr�|d}||jvr�|j||d<n|jdur�|j|d<|�|�}t|�s�td|f��|fi|��}|�	d|j
|j
�}t|�s�td|f��|tu�rtd	|f��t|d
��rFz|�
��|d�Wnt�yDtd��Yn0|�|�S)NrSrr�z+dest supplied twice for positional argumentr�zunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)rErsr��_get_positional_kwargs�_get_optional_kwargsrNrD�_pop_action_class�callablerSrrr�rr�r��_add_action)r&r\r�charsr�Zaction_classru�	type_funcr+r+r,rwps:	 




�z_ActionsContainer.add_argumentcOs&t|g|�Ri|��}|j�|�|Sr.)�_ArgumentGrouprLr!)r&r\rr�r+r+r,�add_argument_group�sz$_ActionsContainer.add_argument_groupcKs t|fi|��}|j�|�|Sr.)�_MutuallyExclusiveGrouprMr!)r&rr�r+r+r,�add_mutually_exclusive_group�sz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictrJr!�	containerr�rKrO�matchrP)r&rur�r+r+r,r\�s


z_ActionsContainer._add_actioncCs|j�|�dSr.)rJ�remover�r+r+r,�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|vr.td�}t||j��|||j<q
i}|jD]D}|j|vrn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titlerCrF)r�)rLrhr�r�r`rCrFr�rMrbr�rJr�r\)r&rdZtitle_group_mapr�r%Z	group_mapru�mutex_groupr+r+r,�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|vrtd�}t|��|�d�ttfvr2d|d<|�d�tkrPd|vrPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�rrr�)r&r�rr%r+r+r,rX�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]`}|d|jvr>||jd�}td�}t||��|�|�t|�dkr|d|jvr|�|�q|�dd�}|dur�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionrEzNinvalid option string %(option)r: must start with a character %(prefix_chars)rrSr�z%dest= is required for options like %rr1r�rk)	rEr�r�r!rsr��lstrip�replacer�)	r&r\rr�Zlong_option_stringsr�r%r�Zdest_option_stringr+r+r,rY�s.�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nru)r�rS)r&rr�rur+r+r,rZsz#_ActionsContainer._pop_action_classcCsDd|j}zt||�WSty>td�}t||j��Yn0dS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)rFr�r�r�r�)r&Zhandler_func_namer%r+r+r,rI#s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jvr
|j|}|�||f�q
|rH|��}|||�dSr.)r�rKr!rI)r&ruZconfl_optionalsr�Zconfl_optionalrFr+r+r,rc,s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr+r+)rZr�rur+r+r,r]>s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rrsr%r)r&ru�conflicting_actionsr�Zconflict_stringr+r+r,�_handle_conflict_error:s�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr.)r�rfrKr�rdrg)r&ruror�r+r+r,�_handle_conflict_resolveCs
z*_ActionsContainer._handle_conflict_resolve)N)N)rr3r4rQrHrSrUrVrwr`rbr\rgrjrXrYrZrIrcrprqr�r+r+r�r,r@s$5
	
3("
		r@cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	r_Ncs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)NrFrErDrC)r#rFrErDr�r_rQrhr�rGrJrKrNrPrM)r&rdrhrCrrTZ
super_initr�r+r,rQTs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr.)r�r_r\r�r!r�r�r+r,r\jsz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr.)r�r_rgr�rfr�r�r+r,rgosz_ArgumentGroup._remove_action)NN�rr3r4rQr\rgr�r+r+r�r,r_Rsr_cs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	raFcs tt|��|�||_||_dSr.)r�rarQr��
_container)r&rdr�r�r+r,rQvsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rsr\r�r!)r&rur%r+r+r,r\{sz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr.)rsrgr�rfr�r+r+r,rg�sz&_MutuallyExclusiveGroup._remove_action)Frrr+r+r�r,ratsrac
s(eZdZddddgedddddddf
�fdd�	Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	d@dd�Z
dAdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdBd%d&�ZdCd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdDd5d6�ZdEd7d8�ZdFd9d:�ZdGd<d=�Zd>d?�Z �Z!S)HrNr1r4Tc	s&tt|�j}||||	|
d�|dur6tj�tjd�}||_||_	||_
||_||_||_
||_|
|_|j}|td��|_|td��|_d|_dd�}|�dd|�d|vr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]:}|�|�z
|j}Wnt�yYq�0|j�|�q�dS)N)rCrErDrFrzpositional argumentszoptional argumentscSs|Sr.r+)r9r+r+r,�identity�sz)ArgumentParser.__init__.<locals>.identityrr1�hr8rozshow this help message and exit)rur�ro)r�rrQ�_os�path�basenamer�argvrOrj�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrev�
exit_on_errorr`r��_positionals�
_optionals�_subparsersrHrwrrjrNr�rT)r&rOrjrCrz�parentsr{rEr|rDrFr}r~rZ	superinitZ	add_grouprtZdefault_prefixrX�defaultsr�r+r,rQ�sH��

zArgumentParser.__init__csgd�}�fdd�|D�S)N)rOrjrCr{rFr}csg|]}|t�|�f�qSr+r�r�r2r+r,r]�r^z.ArgumentParser._get_kwargs.<locals>.<listcomp>r+r�r+r2r,r#�szArgumentParser._get_kwargsc	Ks�|jdur|�td��|�dt|��d|vs8d|vrht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dur�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrrhrCZsubcommandsrOr_rBr�)r�r4r�r#rr�r`r�r�r�_get_positional_actionsrMrnrjrbr{rZr\)	r&rrhrCrWr�rlZ
parsers_classrur+r+r,�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr.)r�r�r\r�r�r+r+r,r\szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr+r��rZrur+r+r,r]s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�rJr2r+r+r,�_get_optional_actionss�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr+r�r�r+r+r,r]s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>r�r2r+r+r,r�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr~)r"r�r4r%�r&r\r�ryr%r+r+r,�
parse_args s
zArgumentParser.parse_argscCs|durtjdd�}nt|�}|dur.t�}|jD]4}|jtur4t||j�s4|jtur4t	||j|j�q4|j
D] }t||�spt	|||j
|�qp|jr�z|�||�\}}Wq�t
y�t��d}|�t|��Yq�0n|�||�\}}t|t��r|�t|t��t|t�||fSrR)rryr/rrJr�rr�r�r�rNr�_parse_known_argsr�exc_infor4r�r$r�r��delattr)r&r\r�rur��errr+r+r,r"'s0





zArgumentParser.parse_known_argscs�	jdur�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dur�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�v�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�v�r|j�r(|�t|��nT|jdu�rt|jt��rt�|j��r|jt�|j�u�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�v�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrSr�r1�A�Or_cs|��|���||�}||jurb��|���|g�D]*}|�vr6td�}t|�}t|||��q6|turx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)ruZargument_stringsr�Zargument_valuesZconflict_actionr%Zaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr&r+r,�take_action}s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs~�|}|\}}}�j}g}|dur:���|�|dS|du�r||d�}�j}|dkr�|d|vr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||vr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|D]\}}}�|||��q`|
S)NrSr�rzignored explicit argument %r)�_match_argumentr!rErKr�r)�start_index�option_tuplerur��explicit_argZmatch_argumentZ
action_tuples�	arg_countr]�charZnew_explicit_argZ
optionals_mapr%�stopr\r�Zselected_patterns)r'�arg_strings_pattern�extras�option_string_indicesr&r�r+r,�consume_optional�sL



z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr.)�_match_arguments_partial�ziprs)r�Z
match_partialZselected_patternZ
arg_countsrur�r\)r'r�r�r&r�r+r,�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr+r+)rZr�)r�r+r,r]�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jturt|��qSr+)rorr�r�r+r+r,r];s
�z#one of the arguments %s is requiredr~)N)r|�_read_args_from_filesrMr�r�r#r��iterr!�_parse_optionalr%r�r�rAr@rJr�r�r�r�r�r�r�r�r��
_get_valuer4r�)r&r'r�rir�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrur�r�r%r+)r�r'r�r�r�r�r�r�r�r&r�r�r,r�Ns�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc	Cs�g}|D]�}|r|d|jvr*|�|�qzxt|dd���T}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�Wd�n1s�0YWqty�t	�
�d}|�t|��Yq0q|Sr)
r|r!r��readr��convert_arg_line_to_argsr�r�r8rr�r4r�)r&r'Znew_arg_stringsr�Z	args_file�arg_liner(r�r+r+r,r�Ds 
,z$ArgumentParser._read_args_from_filescCs|gSr.r+)r&r�r+r+r,r�^sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|durldtd�ttd�ttd�i}|�|j�}|durbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrS)�_get_nargs_patternrJrer�rr
r�r�rrrsr�)r&rur��
nargs_patternreZnargs_errorsr%r+r+r,r�as"
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dur|�dd�|��D��qnq|S)Nrr�r_csg|]}��|��qSr+)r�r�r2r+r,r]}s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr+)rs)rZr9r+r+r,r]�r^)r�rsr%rJrer�rl)r&rkr�r�r�Z
actions_slicer�rer+r2r,r�ws�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jvrdS||jvr8|j|}||dfSt|�dkrHdSd|vr~|�dd�\}}||jvr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|v�rdSd|dfS)
NrrS�=rcSsg|]\}}}|�qSr+r+)rZrur�r�r+r+r,r]�s�z2ArgumentParser._parse_optional.<locals>.<listcomp>)rlZmatchesz4ambiguous option: %(option)s could match %(matches)sr~)rErKrs�split�_get_option_tuplesr%r�r4rOrerP)
r&r�rur�r�Z
option_tuplesZoptionsr\r%r�r+r+r,r��s>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|vr�|d|vr�|jr~d|vrB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|v�r|d|v�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrSr�r8zunexpected option string: %s)rEr~r�rKr�r!r4r�)
r&r�r�r]Z
option_prefixr�rur�Zshort_option_prefixZshort_explicit_argr+r+r,r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|durd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r_r1)
r�rrr
rrrr%r�rn)r&rur�r�r+r+r,r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr�)�parse_known_intermixed_argsr�r4r%r�r+r+r,�parse_intermixed_args	s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���z�|j}z�|jdurp|��dd�|_�D] }|j|_t|_|j|_	t|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W�D]}|j|_|j	|_q�n�D]}|j|_|j	|_�q0|��}zt|D]}|j|_d
|_�q@|jD]}	|	j|	_d
|	_�q\|�
||�\}}
W|D]}|j|_�q�|jD]}	|	j|	_�q�n,|D]}|j|_�q�|jD]}	|	j|	_�q�0W||_n||_0||
fS)NcSsg|]}|jttfvr|�qSr+)r�rrr�r+r+r,r]4	s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�vr|j�qqSr+)r�r�)rZr�ru�r�r+r,r]:	s�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)r�r�r�rMrjr�Z
save_nargsrr�Zsave_defaultr"r�r�r��warningsr�r�r�r�Z
save_required)r&r\r��aZ
save_usageruZremaining_argsr�r�r�r�r+r�r,r�&	sn
�
���


�

�
z*ArgumentParser.parse_known_intermixed_argscs��jttfvr0z|�d�Wnty.Yn0|sx�jtkrx�jrL�j}n�j}t	|t
�rt���|�}���|��n|s��jt
kr��js��jdur��j}n|}���|�n�t|�dkr�jdtfvr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r>��fdd�|D�}���|d�n>�jtk�rPt}n,��fdd�|D�}|D]}���|��qh|S)Nr�rScsg|]}���|��qSr+�r��rZ�v�rur&r+r,r]�	r^z.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr+r�r�r�r+r,r]�	r^rcsg|]}���|��qSr+r�r�r�r+r,r]�	r^)r�rrrfr�rr�r�r�r�r�r��_check_valuerrsr)r&rur'r*r�r�r+r�r,r�s	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�ty|t|jdt|j��}tt	�
�d�}t||��YnJttfy�t|jdt|j��}||d�}td�}t|||��Yn0|S)NrrWrrS)rr*z!invalid %(type)s value: %(value)r)
rSrr[r�rrr�r"r�rr�r�r�)r&rur�r^r%r�r)r\r+r+r,r��	s 
zArgumentParser._get_valuecCsF|jdurB||jvrB|d�tt|j��d�}td�}t|||��dS)Nr)r*r�z3invalid choice: %(value)r (choose from %(choices)s))r�r%rrr"r�r)r&rur*r\r%r+r+r,r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr.)rrnrjrJrMrb)r&rWr+r+r,r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr.)rrnrjrJrMrhrCrLrdrhrxr�rerzrb)r&rWZaction_groupr+r+r,rb�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr})r{rOr2r+r+r,r�	szArgumentParser._get_formattercCs"|durtj}|�|��|�dSr.)rrrr��r&�filer+r+r,�print_usage�	szArgumentParser.print_usagecCs"|durtj}|�|��|�dSr.)rrrrbr�r+r+r,r�	szArgumentParser.print_helpcCs |r|durtj}|�|�dSr.)r�stderr�write)r&r�r�r+r+r,r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr.)rrr�r
)r&Zstatusr�r+r+r,r

szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)N)rOr�r8z%(prog)s: error: %(message)s
)r�rr�rOr
r�)r&r�r\r+r+r,r4
s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)"rr3r4rrQr#r�r\r�r�r�r"r�r�r�r�r�r�r�r�r�r�r�r�r�r�rbrr�rrr
r4r�r+r+r�r,r�sV�B

'w:-1

M8


	
r)1�__version__�__all__�osrv�rerJ�sysrrr�rrrrr
rrr$r�rr7rrr	rr
r��	Exceptionrrrrr�r�r�rrrrr
rrr'rrr@r_rarr+r+r+r,�<module>As^	^)#&]78"

?>