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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /usr/lib64/python3.6/__pycache__
Viewing File: /usr/lib64/python3.6/__pycache__/argparse.cpython-36.pyc
3 \a�@s0dZdZdddddddd d d d d dddddgZddlZddlZddlZddl Z ddl Z ddl ZddlmZmZdZdZdZdZdZdZdZGdd�de�Zdd �ZGd!d�de�ZGd"d�de�ZGd#d �d e�ZGd$d�de�ZGd%d �d e�Z d&d'�Z!Gd(d�de"�Z#Gd)d�de"�Z$Gd*d �d e�Z%Gd+d,�d,e%�Z&Gd-d.�d.e%�Z'Gd/d0�d0e'�Z(Gd1d2�d2e'�Z)Gd3d4�d4e%�Z*Gd5d6�d6e%�Z+Gd7d8�d8e%�Z,Gd9d:�d:e%�Z-Gd;d<�d<e%�Z.Gd=d>�d>e%�Z/Gd?d�de�Z0Gd@d �d e�Z1GdAdB�dBe�Z2GdCdD�dDe2�Z3GdEdF�dFe3�Z4GdGd�dee2�Z5dS)Ha� Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The following is a simple usage example that sums integers from the command-line and writes the result to a file:: parser = argparse.ArgumentParser( description='sum the integers at the command line') parser.add_argument( 'integers', metavar='int', nargs='+', type=int, help='an integer to be summed') parser.add_argument( '--log', default=sys.stdout, type=argparse.FileType('w'), help='the file where the sum should be written') args = parser.parse_args() args.log.write('%s' % sum(args.integers)) args.log.close() The module contains the following public classes: - ArgumentParser -- The main entry point for command-line parsing. As the example above shows, the add_argument() method is used to populate the parser with actions for optional and positional arguments. Then the parse_args() method is invoked to convert the args at the command-line into an object with attributes. - ArgumentError -- The exception raised by ArgumentParser objects when there are errors with the parser's actions. Errors raised while parsing the command-line are caught by ArgumentParser and emitted as command-line messages. - FileType -- A factory for defining types of files to be created. As the example above shows, instances of FileType are typically passed as the type= argument of add_argument() calls. - Action -- The base class for parser actions. Typically actions are selected by passing strings like 'store_true' or 'append_const' to the action= argument of add_argument(). However, for greater customization of ArgumentParser actions, subclasses of Action may be defined and passed as the action= argument. - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, ArgumentDefaultsHelpFormatter -- Formatter classes which may be passed as the formatter_class= argument to the ArgumentParser constructor. HelpFormatter is the default, RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser not to change the formatting for help text, and ArgumentDefaultsHelpFormatter adds information about argument defaults to the help. All other classes in this module are considered implementation details. (Also note that HelpFormatter and RawDescriptionHelpFormatter are only considered public as object names -- the API of the formatter objects is still considered an implementation detail.) z1.1�ArgumentParser� ArgumentError�ArgumentTypeError�FileType� HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter� Namespace�Action� ONE_OR_MORE�OPTIONAL�PARSER� REMAINDER�SUPPRESS� ZERO_OR_MORE�N)�gettext�ngettextz ==SUPPRESS==�?�*�+zA...z...Z_unrecognized_argsc@s(eZdZdZdd�Zdd�Zdd�ZdS) �_AttributeHolderaAbstract base class that provides __repr__. The __repr__ method returns a string in the format:: ClassName(attr=name, attr=name, ...) The attributes are determined either by a class-level attribute, '_kwarg_names', or by inspecting the instance __dict__. cCs�t|�j}g}i}x|j�D]}|jt|��qWx8|j�D],\}}|j�r`|jd||f�q<|||<q<W|r�|jdt|��d|dj|�fS)Nz%s=%rz**%sz%s(%s)z, )�type�__name__� _get_args�append�repr� _get_kwargs� isidentifier�join)�selfZ type_name� arg_stringsZ star_args�arg�name�value�r&� /usr/lib64/python3.6/argparse.py�__repr__vs  z_AttributeHolder.__repr__cCst|jj��S)N)�sorted�__dict__�items)r!r&r&r'r�sz_AttributeHolder._get_kwargscCsgS)Nr&)r!r&r&r'r�sz_AttributeHolder._get_argsN)r� __module__� __qualname__�__doc__r(rrr&r&r&r'rmsrcCs&t||d�dkrt|||�t||�S)N)�getattr�setattr)� namespacer$r%r&r&r'� _ensure_value�s r2c@s�eZdZdZd;dd�Zdd�Zd d �ZGd d �d e�Zd d�Z dd�Z dd�Z dd�Z d<dd�Z dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)=rz�Formatter for generating usage messages and argument help strings. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. ��NcCs�|dkr@yttjd�}Wnttfk r6d}YnX|d8}||_||_||_t|t |d|d��|_||_ d|_ d|_ d|_ |j|d�|_|j|_tjdtj�|_tjd�|_dS)NZCOLUMNS�Pr3�rz\s+z\n\n\n+)�int�_os�environ�KeyError� ValueError�_prog�_indent_increment�_max_help_position�min�max�_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'�__init__�s& zHelpFormatter.__init__cCs"|j|j7_|jd7_dS)N�)rBr=rC)r!r&r&r'�_indent�szHelpFormatter._indentcCs4|j|j8_|jdks"td��|jd8_dS)NrzIndent decreased below 0.rP)rBr=�AssertionErrorrC)r!r&r&r'�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dS)N)� formatter�parent�headingr+)r!rTrUrVr&r&r'rO�szHelpFormatter._Section.__init__cCs�|jdk r|jj�|jj}|dd�|jD��}|jdk rD|jj�|sLdS|jtk rz|jdk rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr&r&)�.0�func�argsr&r&r'� <listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s: � ) rUrTrQ� _join_partsr+rSrVrrB)r!r Z item_helpZcurrent_indentrVr&r&r'� format_help�s    z"HelpFormatter._Section.format_help)N)rr,r-rOr^r&r&r&r'rE�s rEcCs|jjj||f�dS)N)rGr+r)r!rXrYr&r&r'� _add_item�szHelpFormatter._add_itemcCs0|j�|j||j|�}|j|jg�||_dS)N)rQrErGr_r^)r!rVZsectionr&r&r'� start_section�szHelpFormatter.start_sectioncCs|jj|_|j�dS)N)rGrUrS)r!r&r&r'� end_section�s zHelpFormatter.end_sectioncCs$|tk r |dk r |j|j|g�dS)N)rr_� _format_text)r!�textr&r&r'�add_text�szHelpFormatter.add_textcCs&|tk r"||||f}|j|j|�dS)N)rr_� _format_usage)r!�usage�actions�groups�prefixrYr&r&r'� add_usage�s zHelpFormatter.add_usagecCsz|jtk rv|j}||�g}x |j|�D]}|j||��q&Wtdd�|D��}||j}t|j|�|_|j|j |g�dS)NcSsg|] }t|��qSr&)�len)rW�sr&r&r'rZ sz.HelpFormatter.add_argument.<locals>.<listcomp>) �helpr�_format_action_invocation�_iter_indented_subactionsrr@rBrDr_�_format_action)r!�actionZget_invocationZ invocations� subactionZinvocation_lengthZ action_lengthr&r&r'� add_arguments   zHelpFormatter.add_argumentcCsx|D]}|j|�qWdS)N)rs)r!rgrqr&r&r'� add_argumentss zHelpFormatter.add_argumentscCs.|jj�}|r*|jjd|�}|jd�d}|S)Nz r\)rFr^rL�sub�strip)r!rmr&r&r'r^s  zHelpFormatter.format_helpcCsdjdd�|D��S)Nr[cSsg|]}|r|tk r|�qSr&)r)rW�partr&r&r'rZ!sz-HelpFormatter._join_parts.<locals>.<listcomp>)r )r!Z part_stringsr&r&r'r] s zHelpFormatter._join_partscs<|dkrtd�}|dk r,|t|jd�}�n|dkrN| rNdt|jd�}�n�|dk�r0dt|jd�}g}g}x(|D] }|jr�|j|�qv|j|�qvW|j} | |||�} djdd�|| gD��}|j|j�t |�t |��k�r0d} | ||�} | ||�} t j | | �}t j | | �}dj|�| k�s,t �dj|�| k�s@t �d�fdd � }t |�t |�d �k�r�dt |�t |�d }|�r�||g|||�}|j |||��n |�r�||g|||�}n|g}nZdt |�}||}|||�}t |�d k�rg}|j |||��|j |||��|g|}d j|�}d ||fS)Nzusage: )rMz%(prog)s� cSsg|] }|r|�qSr&r&)rWrlr&r&r'rZAsz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk rt|�d}n t|�d}xb|D]Z}|dt|��krp|rp|j|dj|��g}t|�d}|j|�|t|�d7}q0W|r�|j|dj|��|dk r�|dt|�d�|d<|S)NrPrxr)rkrr )�parts�indentri�lines�lineZline_lenrw)� text_widthr&r'� get_linesUs"    z.HelpFormatter._format_usage.<locals>.get_linesg�?rPr\z%s%s )N)�_�dictr<�option_stringsr�_format_actions_usager rArBrkrH�findallrR�extend)r!rfrgrhrirMZ optionals� positionalsrq�formatZ action_usageZ part_regexpZ opt_usageZ pos_usageZ opt_partsZ pos_partsr~rzr{ryr&)r}r're%sZ            zHelpFormatter._format_usagec Cs�t�}i}x�|D]�}y|j|jd�}Wntk r>wYqX|t|j�}|||�|jkrx|jD]}|j|�qhW|js�||kr�||d7<nd||<d||<n*||kr�||d7<nd||<d||<xt|d|�D] } d || <q�WqWg} �x2t|�D�]$\} }|j t k�rj| j d�|j | �d k�rF|j | �n"|j | d�d k�r.|j | d�n�|j�s�|j|�} |j|| �} ||k�r�| ddk�r�| ddk�r�| dd�} | j | �nh|jd} |jdk�r�d | } n"|j|�} |j|| �}d | |f} |j �r$||k�r$d | } | j | ��q Wx(t|d d�D]} || g| | | �<�qBWdjdd�| D��}d}d}tjd|d|�}tjd|d|�}tjd||fd|�}tjdd|�}|j�}|S)Nrz [�[�]z (�(�)rP�|z%sz%s %sz[%s]T)�reverserxcSsg|]}|dk r|�qS)Nr&)rW�itemr&r&r'rZ�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1z (%s)z%s *%sr[z \(([^|]*)\)���r�)�set�index�_group_actionsr;rk�add�required�range� enumeratermrr�get�popr��#_get_default_metavar_for_positional� _format_args�nargs�!_get_default_metavar_for_optionalr)r rHrurv)r!rgrh� group_actionsZinserts�group�start�endrq�iry�defaultrw� option_string� args_stringrc�open�closer&r&r'r��sr                 z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|j|||�dS)Nz%(prog))rM� rxz )r�r<r@rArB� _fill_text)r!rcr}rzr&r&r'rb�s  zHelpFormatter._format_textc CsBt|jd|j�}t|j|d�}||jd}|j|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|j |�} |j | |�} |j d|d| df�x@| dd�D]} |j d|d| f�q�Wn|j d��s|j d�x$|j |�D]} |j |j| ���qW|j|�S) Nr3r�r[z%*s%s z %*s%-*s rrPr\)r?rDr>r@rArBrnrmrk� _expand_help� _split_linesr�endswithrorpr]) r!rqZ help_positionZ help_widthZ action_widthZ action_header�tupZ indent_firstryZ help_textZ help_linesr|rrr&r&r'rp�s6          zHelpFormatter._format_actioncCs�|js&|j|�}|j||�d�\}|Sg}|jdkrB|j|j�n8|j|�}|j||�}x |jD]}|jd||f�q`Wdj|�SdS)NrPrz%s %sz, ) r�r��_metavar_formatterr�r�r�r�rr )r!rqr��metavarryr�r�r&r&r'rns     z'HelpFormatter._format_action_invocationcsP|jdk r|j�n.|jdk r<dd�|jD�}ddj|��n|��fdd�}|S)NcSsg|] }t|��qSr&)�str)rWZchoicer&r&r'rZ8sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdS)N)� isinstance�tuple)Z tuple_size)�resultr&r'r�=s z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr )r!rq�default_metavarZ choice_strsr�r&)r�r'r�4s   z HelpFormatter._metavar_formattercCs�|j||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}nh|jtkrld|d�}nP|jtkr|d}n@|jtkr�d|d�}n(d d �t|j�D�}d j|�||j�}|S) Nz%srPz[%s]z [%s [%s ...]]r3z %s [%s ...]z...z%s ...cSsg|]}d�qS)z%sr&)rWrr&r&r'rZSsz.HelpFormatter._format_args.<locals>.<listcomp>rx) r�r�r rr rrr�r )r!rqr�Z get_metavarr�Zformatsr&r&r'r�Ds        zHelpFormatter._format_argscCs�tt|�|jd�}x"t|�D]}||tkr||=qWx,t|�D] }t||d�r@||j||<q@W|jd�dk r�djdd�|dD��}||d<|j |�|S)N)rMrr�z, cSsg|] }t|��qSr&)r�)rW�cr&r&r'rZ`sz.HelpFormatter._expand_help.<locals>.<listcomp>) r��varsr<�listr�hasattrrr�r �_get_help_string)r!rqZparamsr$Z choices_strr&r&r'r�Ws  zHelpFormatter._expand_helpc cs@y |j}Wntk rYnX|j�|�EdH|j�dS)N)�_get_subactions�AttributeErrorrQrS)r!rqZget_subactionsr&r&r'rods  z'HelpFormatter._iter_indented_subactionscCs|jjd|�j�}tj||�S)Nrx)rKrurv� _textwrapZwrap)r!rcrNr&r&r'r�nszHelpFormatter._split_linescCs$|jjd|�j�}tj||||d�S)Nrx)Zinitial_indentZsubsequent_indent)rKrurvr�Zfill)r!rcrNrzr&r&r'r�rs zHelpFormatter._fill_textcCs|jS)N)rm)r!rqr&r&r'r�wszHelpFormatter._get_help_stringcCs |jj�S)N)�dest�upper)r!rqr&r&r'r�zsz/HelpFormatter._get_default_metavar_for_optionalcCs|jS)N)r�)r!rqr&r&r'r�}sz1HelpFormatter._get_default_metavar_for_positional)r3r4N)N) rr,r-r.rOrQrS�objectrEr_r`rardrjrsrtr^r]rer�rbrprnr�r�r�ror�r�r�r�r�r&r&r&r'r�s<  `a/  c@seZdZdZdd�ZdS)rz�Help message formatter which retains any formatting in descriptions. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cs dj�fdd�|jdd�D��S)Nr[c3s|]}�|VqdS)Nr&)rWr|)rzr&r'� <genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r � splitlines)r!rcrNrzr&)rzr'r��sz&RawDescriptionHelpFormatter._fill_textN)rr,r-r.r�r&r&r&r'r�sc@seZdZdZdd�ZdS)rz�Help message formatter which retains formatting of all help text. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cCs|j�S)N)r�)r!rcrNr&r&r'r��sz!RawTextHelpFormatter._split_linesN)rr,r-r.r�r&r&r&r'r�sc@seZdZdZdd�ZdS)rz�Help message formatter which adds default values to argument help. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cCs>|j}d|jkr:|jtk r:ttg}|js2|j|kr:|d7}|S)Nz %(default)z (default: %(default)s))rmr�rr rr�r�)r!rqrmZdefaulting_nargsr&r&r'r��s  z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr,r-r.r�r&r&r&r'r�sc@s eZdZdZdd�Zdd�ZdS)r a Help message formatter which uses the argument 'type' as the default metavar value (instead of the argument 'dest') Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cCs|jjS)N)rr)r!rqr&r&r'r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjS)N)rr)r!rqr&r&r'r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr,r-r.r�r�r&r&r&r'r �scCsN|dkr dS|jrdj|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r r�rr�)�argumentr&r&r'�_get_action_name�s r�c@s eZdZdZdd�Zdd�ZdS)rz�An error from creating or using an argument (optional or positional). The string value of this exception is the message, augmented with information about the argument that caused it. cCst|�|_||_dS)N)r�� argument_name�message)r!r�r�r&r&r'rO�s zArgumentError.__init__cCs(|jdkrd}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)rr,r-r.rOr�r&r&r&r'r�sc@seZdZdZdS)rz@An error from trying to convert a command line string to a type.N)rr,r-r.r&r&r&r'r�sc@s,eZdZdZd dd�Zdd�Zd dd �ZdS) r a\ Information about how to convert command line strings to Python objects. Action objects are used by an ArgumentParser to represent the information needed to parse a single argument from one or more strings from the command line. The keyword arguments to the Action constructor are also all attributes of Action instances. Keyword Arguments: - option_strings -- A list of command-line option strings which should be associated with this action. - dest -- The name of the attribute to hold the created object(s) - nargs -- The number of command-line arguments that should be consumed. By default, one argument will be consumed and a single value will be produced. Other values include: - N (an integer) consumes N arguments (and produces a list) - '?' consumes zero or one arguments - '*' consumes zero or more arguments (and produces a list) - '+' consumes one or more arguments (and produces a list) Note that the difference between the default and nargs=1 is that with the default, a single value will be produced, while with nargs=1, a list containing a single value will be produced. - const -- The value to be produced if the option is specified and the option uses an action that takes no values. - default -- The value to be produced if the option is not specified. - type -- A callable that accepts a single string argument, and returns the converted value. The standard Python types str, int, float, and complex are useful examples of such callables. If None, str is used. - choices -- A container of values that should be allowed. If not None, after a command-line argument has been converted to the appropriate type, an exception will be raised if it is not a member of this collection. - required -- True if the action must always be specified at the command line. This is only meaningful for optional command-line arguments. - help -- The help string describing the argument. - metavar -- The name to be used for the option's argument with the help string. If None, the 'dest' value will be used as the name. NFc Cs@||_||_||_||_||_||_||_||_| |_| |_ dS)N) r�r�r��constr�rr�r�rmr�) r!r�r�r�r�r�rr�r�rmr�r&r&r'rOs zAction.__init__c s(ddddddddd g }�fd d �|D�S) Nr�r�r�r�r�rr�rmr�csg|]}|t�|�f�qSr&)r/)rWr$)r!r&r'rZ;sz&Action._get_kwargs.<locals>.<listcomp>r&)r!�namesr&)r!r'r/szAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr)r!�parserr1�valuesr�r&r&r'�__call__=szAction.__call__)NNNNNFNN)N)rr,r-r.rOrr�r&r&r&r'r �s1 cs(eZdZd�fdd� Zddd�Z�ZS) � _StoreActionNFc sT|dkrtd��|dk r,|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 appropriatez nargs must be %r to supply const) r�r�r�r�r�rr�r�rmr�)r;r �superr�rO) r!r�r�r�r�r�rr�r�rmr�)� __class__r&r'rOCs   z_StoreAction.__init__cCst||j|�dS)N)r0r�)r!r�r1r�r�r&r&r'r�`sz_StoreAction.__call__)NNNNNFNN)N)rr,r-rOr�� __classcell__r&r&)r�r'r�Asr�cs(eZdZd�fdd� Zddd�Z�ZS) �_StoreConstActionNFc s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rm)r�r�rO)r!r�r�r�r�r�rmr�)r�r&r'rOfs z_StoreConstAction.__init__cCst||j|j�dS)N)r0r�r�)r!r�r1r�r�r&r&r'r�wsz_StoreConstAction.__call__)NFNN)N)rr,r-rOr�r�r&r&)r�r'r�ds  r�cseZdZd�fdd� Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT)r�r�r�r�r�rm)r�r�rO)r!r�r�r�r�rm)r�r&r'rO}s z_StoreTrueAction.__init__)FFN)rr,r-rOr�r&r&)r�r'r�{sr�cseZdZd�fdd� Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NF)r�r�r�r�r�rm)r�r�rO)r!r�r�r�r�rm)r�r&r'rO�s z_StoreFalseAction.__init__)TFN)rr,r-rOr�r&r&)r�r'r��sr�cs(eZdZd�fdd� Zddd�Z�ZS) � _AppendActionNFc sT|dkrtd��|dk r,|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 appropriatez nargs must be %r to supply const) r�r�r�r�r�rr�r�rmr�)r;r r�r�rO) r!r�r�r�r�r�rr�r�rmr�)r�r&r'rO�s   z_AppendAction.__init__cCs0tjt||jg��}|j|�t||j|�dS)N)�_copy�copyr2r�rr0)r!r�r1r�r�r+r&r&r'r��s z_AppendAction.__call__)NNNNNFNN)N)rr,r-rOr�r�r&r&)r�r'r��sr�cs(eZdZd�fdd� Zddd�Z�ZS) �_AppendConstActionNFc s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rmr�)r�r�rO)r!r�r�r�r�r�rmr�)r�r&r'rO�s z_AppendConstAction.__init__cCs2tjt||jg��}|j|j�t||j|�dS)N)r�r�r2r�rr�r0)r!r�r1r�r�r+r&r&r'r��s z_AppendConstAction.__call__)NFNN)N)rr,r-rOr�r�r&r&)r�r'r��s  r�cs(eZdZd�fdd� Zddd�Z�ZS) � _CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rm)r�r�rO)r!r�r�r�r�rm)r�r&r'rO�s z_CountAction.__init__cCs$t||jd�d}t||j|�dS)NrrP)r2r�r0)r!r�r1r�r�Z new_countr&r&r'r��sz_CountAction.__call__)NFN)N)rr,r-rOr�r�r&r&)r�r'r��s r�cs.eZdZeedf�fdd� Zddd�Z�ZS)� _HelpActionNcstt|�j|||d|d�dS)Nr)r�r�r�r�rm)r�r�rO)r!r�r�r�rm)r�r&r'rO�s  z_HelpAction.__init__cCs|j�|j�dS)N)� print_help�exit)r!r�r1r�r�r&r&r'r��sz_HelpAction.__call__)N)rr,r-rrOr�r�r&r&)r�r'r��sr�cs0eZdZdeedf�fdd� Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dS)Nr)r�r�r�r�rm)r�r�rO�version)r!r�r�r�r�rm)r�r&r'rOs z_VersionAction.__init__cCsD|j}|dkr|j}|j�}|j|�|j|j�tj�|j�dS)N)r��_get_formatterrd�_print_messager^�_sys�stdoutr�)r!r�r1r�r�r�rTr&r&r'r�s z_VersionAction.__call__)N)rr,r-rrOr�r�r&r&)r�r'r�s  r�csNeZdZGdd�de�Zeddf�fdd� Zdd�Zdd �Zd d d �Z �Z S) �_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|ddj|�7}ttj|�}|jg|||d�dS)Nz (%s)z, )r�r�rmr�)r r�r��_ChoicesPseudoActionrO)r!r$�aliasesrmr�r�Zsup)r�r&r'rO"s   z/_SubParsersAction._ChoicesPseudoAction.__init__)rr,r-rOr�r&r&)r�r'r� sr�Ncs>||_||_tj�|_g|_tt|�j||t |j||d�dS)N)r�r�r�r�rmr�) � _prog_prefix� _parser_class� _collections� OrderedDict�_name_parser_map�_choices_actionsr�r�rOr)r!r�rM� parser_classr�rmr�)r�r&r'rO*s  z_SubParsersAction.__init__cKs�|jd�dkr d|j|f|d<|jdf�}d|krX|jd�}|j|||�}|jj|�|jf|�}||j|<x|D]}||j|<qtW|S)NrMz%s %sr�rm)r�r�r�r�r�rr�r�)r!r$�kwargsr�rmZ choice_actionr��aliasr&r&r'� add_parser?s      z_SubParsersAction.add_parsercCs|jS)N)r�)r!r&r&r'r�Vsz!_SubParsersAction._get_subactionsc Cs�|d}|dd�}|jtk r,t||j|�y|j|}Wn<tk rv|dj|j�d�}td�|}t||��YnX|j|d�\} }x$t | �j �D]\} } t|| | �q�W|r�t |�j t g�t |t �j|�dS)NrrPz, )� parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr0r�r:r rr�parse_known_argsr�r+� setdefault�_UNRECOGNIZED_ARGS_ATTRr/r�) r!r�r1r�r�r�r"rY�msgZ subnamespace�keyr%r&r&r'r�Ys"    z_SubParsersAction.__call__)N) rr,r-r r�rrOr�r�r�r�r&r&)r�r'r�sr�c@s*eZdZdZd dd�Zdd�Zd d �ZdS) ra�Factory for creating file object types Instances of FileType are typically passed as type= arguments to the ArgumentParser add_argument() method. Keyword Arguments: - mode -- A string indicating how the file is to be opened. Accepts the same values as the builtin open() function. - bufsize -- The file's desired buffer size. Accepts the same values as the builtin open() function. - encoding -- The file's encoding. Accepts the same values as the builtin open() function. - errors -- A string indicating how encoding and decoding errors are to be handled. Accepts the same value as the builtin open() function. �rrPNcCs||_||_||_||_dS)N)�_mode�_bufsize� _encoding�_errors)r!�mode�bufsize�encoding�errorsr&r&r'rO�szFileType.__init__cCs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��yt||j|j|j|j �St k r�}ztd�}t |||f��WYdd}~XnXdS)N�-r��wzargument "-" with mode %rzcan't open '%s': %s) r�r��stdinr�rr;r�r�r�r��OSErrorr)r!�stringr��er�r&r&r'r��s  zFileType.__call__cCsT|j|jf}d|jfd|jfg}djdd�|D�dd�|D��}dt|�j|fS)Nr�r�z, cSsg|]}|dkrt|��qS)rPr�)r)rWr#r&r&r'rZ�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk rd||f�qS)Nz%s=%rr&)rW�kwr#r&r&r'rZ�sz%s(%s))r�r�r�r�r rr)r!rYr�Zargs_strr&r&r'r(�s  zFileType.__repr__r�)r�r�NN)rr,r-r.rOr�r(r&r&r&r'r~s c@s(eZdZdZdd�Zdd�Zdd�ZdS) r z�Simple object for storing attributes. Implements equality by attribute names and values, and provides a simple string representation. cKs"x|D]}t||||�qWdS)N)r0)r!r�r$r&r&r'rO�s zNamespace.__init__cCst|t�stSt|�t|�kS)N)r�r �NotImplementedr�)r!�otherr&r&r'�__eq__�s zNamespace.__eq__cCs ||jkS)N)r*)r!r�r&r&r'� __contains__�szNamespace.__contains__N)rr,r-r.rOr r r&r&r&r'r �scs�eZdZ�fdd�Zdd�Zd&dd�Zdd �Zd d �Zd d �Zdd�Z dd�Z dd�Z dd�Z dd�Z dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|�j�||_||_||_||_i|_|jddt �|jddt �|jddt �|jddt �|jddt �|jddt �|jddt�|jddt�|jdd t�|jdd t�|jdd t�|j�g|_i|_g|_g|_i|_tjd �|_g|_dS) NrqZstore� store_const� store_trueZ store_falserZ append_const�countrmr��parsersz^-\d+$|^-\d*\.\d+$)r�r rO� description�argument_default� prefix_chars�conflict_handler� _registries�registerr�r�r�r�r�r�r�r�r�r�� _get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups� _defaultsrHrI�_negative_number_matcher�_has_negative_number_optionals)r!rrrr)r�r&r'rO�s2 z_ActionsContainer.__init__cCs|jj|i�}|||<dS)N)rr�)r!� registry_namer%r��registryr&r&r'r�sz_ActionsContainer.registerNcCs|j|j||�S)N)rr�)r!rr%r�r&r&r'� _registry_getsz_ActionsContainer._registry_getcKs6|jj|�x$|jD]}|j|kr||j|_qWdS)N)r�updaterr�r�)r!r�rqr&r&r'� set_defaultss   z_ActionsContainer.set_defaultscCs8x(|jD]}|j|kr|jdk r|jSqW|jj|d�S)N)rr�r�rr�)r!r�rqr&r&r'� get_defaults  z_ActionsContainer.get_defaultc Os0|j}| s(t|�dkrJ|dd|krJ|r<d|kr<td��|j||�}n |j||�}d|kr�|d}||jkr�|j||d<n|jdk r�|j|d<|j|�}t|�s�td|f��|f|�}|j d|j |j �}t|�s�td |f��t |d ��r&y|j �j |d�Wntk �r$td ��YnX|j|�S) z� add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...) rPrr�z+dest supplied twice for positional argumentr�Nzunknown action "%s"rz%r is not callabler�z,length of metavar tuple does not match nargs)rrkr;�_get_positional_kwargs�_get_optional_kwargsrr�_pop_action_class�callabler rr�r�r�� TypeError� _add_action)r!rYr��charsr�Z action_classrq� type_funcr&r&r'rss2 "        z_ActionsContainer.add_argumentcOs t|f|�|�}|jj|�|S)N)�_ArgumentGrouprr)r!rYr�r�r&r&r'�add_argument_groupJs z$_ActionsContainer.add_argument_groupcKst|f|�}|jj|�|S)N)�_MutuallyExclusiveGrouprr)r!r�r�r&r&r'�add_mutually_exclusive_groupOs  z._ActionsContainer.add_mutually_exclusive_groupcCsh|j|�|jj|�||_x|jD]}||j|<q$Wx,|jD]"}|jj|�r>|js>|jjd�q>W|S)NT) �_check_conflictrr� containerr�rr�matchr)r!rqr�r&r&r'r)Ts     z_ActionsContainer._add_actioncCs|jj|�dS)N)r�remove)r!rqr&r&r'�_remove_actionisz _ActionsContainer._remove_actioncCs�i}x8|jD].}|j|kr0td�}t||j��|||j<q Wi}xR|jD]H}|j|krt|j|j|j|jd�||j<x|jD]}||j||<q|WqJWx4|jD]*}|j |j d�}x|jD] }|||<q�Wq�Wx |j D]}|j ||�j |�q�WdS)Nz.cannot merge actions - two groups are named %r)�titlerr)r�)rr5rr;r-rrr�rr/r�rr�r))r!r1Ztitle_group_mapr�r�Z group_maprq� mutex_groupr&r&r'�_add_container_actionsls,         z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|jd�ttgkr2d|d<|jd�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr�)r�r�)rr(r�r rr�)r!r�r�r�r&r&r'r$�sz(_ActionsContainer._get_positional_kwargsc Os�g}g}xv|D]n}|d|jkr@||jd�}td�}t||��|j|�|d|jkrt|�dkr|d|jkr|j|�qW|jdd�}|dkr�|r�|d}n|d}|j|j�}|s�td�}t||��|jdd�}t|||d �S) Nr)�optionrzNinvalid option string %(option)r: must start with a character %(prefix_chars)rrPr�z%dest= is required for options like %rrr)r�r�) rrr;rrkr��lstrip�replacer�) r!rYr�r�Zlong_option_stringsr�r�r�Zdest_option_stringr&r&r'r%�s0          z&_ActionsContainer._get_optional_kwargscCs|jd|�}|jd||�S)Nrq)r�r )r!r�r�rqr&r&r'r&�s z#_ActionsContainer._pop_action_classc CsDd|j}y t||�Stk r>td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)rr/r�rr;)r!Zhandler_func_namer�r&r&r'r�s   z_ActionsContainer._get_handlercCsPg}x0|jD]&}||jkr |j|}|j||f�q W|rL|j�}|||�dS)N)r�rrr)r!rqZconfl_optionalsr�Zconfl_optionalrr&r&r'r0�s   z!_ActionsContainer._check_conflictcCs6tddt|��}djdd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %sz, cSsg|] \}}|�qSr&r&)rWr�rqr&r&r'rZ�sz<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rrkr r)r!rq�conflicting_actionsr�Zconflict_stringr&r&r'�_handle_conflict_error�s    z(_ActionsContainer._handle_conflict_errorcCsBx<|D]4\}}|jj|�|jj|d�|js|jj|�qWdS)N)r�r3rr�r1r4)r!rqr;r�r&r&r'�_handle_conflict_resolve�s  z*_ActionsContainer._handle_conflict_resolve)N)N)rr,r-rOrr r"r#rsr-r/r)r4r7r$r%r&rr0r<r=r�r&r&)r�r'r �s$ 4   /($   r cs6eZdZd�fdd� Z�fdd�Z�fdd�Z�ZS) r,Nc s�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j |_ |j |_ |j |_ |j |_ |j |_ |j|_dS)Nrrrr)r�rrrr�r,rOr5r�rrrrrr)r!r1r5rr�r!Z super_init)r�r&r'rO�s    z_ArgumentGroup.__init__cs tt|�j|�}|jj|�|S)N)r�r,r)r�r)r!rq)r�r&r'r)s z_ArgumentGroup._add_actioncs tt|�j|�|jj|�dS)N)r�r,r4r�r3)r!rq)r�r&r'r4sz_ArgumentGroup._remove_action)NN)rr,r-rOr)r4r�r&r&)r�r'r,�s r,cs.eZdZd�fdd� Zdd�Zdd�Z�ZS) r.Fcs tt|�j|�||_||_dS)N)r�r.rOr�� _container)r!r1r�)r�r&r'rOsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|jj|�}|jj|�|S)Nz-mutually exclusive arguments must be optional)r�rr;r>r)r�r)r!rqr�r&r&r'r)$s   z#_MutuallyExclusiveGroup._add_actioncCs|jj|�|jj|�dS)N)r>r4r�r3)r!rqr&r&r'r4,s z&_MutuallyExclusiveGroup._remove_action)F)rr,r-rOr)r4r�r&r&)r�r'r.sr.c seZdZdZddddgeddddddf �fdd� Zdd �Zd d �Zd d �Zdd�Z dd�Z d=dd�Z d>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�Zd?d2d3�Zd@d4d5�ZdAd6d7�ZdBd9d:�Zd;d<�Z�Z S)Cra�Object for parsing command line strings into Python objects. Keyword Arguments: - prog -- The name of the program (default: sys.argv[0]) - usage -- A usage message (default: auto-generated from arguments) - description -- A description of what the program does - epilog -- Text following the argument descriptions - parents -- Parsers whose arguments should be copied into this one - formatter_class -- HelpFormatter class for printing help messages - prefix_chars -- Characters that prefix optional arguments - fromfile_prefix_chars -- Characters that prefix files containing additional arguments - argument_default -- The default value for all arguments - conflict_handler -- String indicating how to handle conflicts - add_help -- Add a -h/-help option - allow_abbrev -- Allow long options to be abbreviated unambiguously Nr�errorTc  s&tt|�j} | ||| | d�|dkr6tjjtjd�}||_||_ ||_ ||_ ||_ | |_ | |_|j}|td��|_|td��|_d|_dd�}|jdd|�d|kr�dn|d}|j r�|j|d |d d d ttd �d �xD|D]<}|j|�y |j}Wntk �rYq�X|jj|�q�WdS)N)rrrrrzpositional argumentszoptional argumentscSs|S)Nr&)rr&r&r'�identityjsz)ArgumentParser.__init__.<locals>.identityrr�hr3rmzshow this help message and exit)rqr�rm)r�rrOr8�path�basenamer��argvrMrf�epilog�formatter_class�fromfile_prefix_chars�add_help� allow_abbrevr-r� _positionals� _optionals� _subparsersrrsrr7rr�r!)r!rMrfrrE�parentsrFrrGrrrHrIZ superinitZ add_groupr@Zdefault_prefixrUZdefaults)r�r&r'rODsB     zArgumentParser.__init__cs"ddddddg}�fdd�|D�S) NrMrfrrFrrHcsg|]}|t�|�f�qSr&)r/)rWr$)r!r&r'rZ�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r&)r!r�r&)r!r'r�szArgumentParser._get_kwargsc Ks�|jdk r|jtd��|jdt|��d|ks8d|krht|jdd��}t|jdd��}|j||�|_n|j|_|jd�dkr�|j �}|j �}|j }|j |j ||d�|j�j�|d<|j|d�}|fd gi|��}|jj|�|S) Nz(cannot have multiple subparser argumentsr�r5rZ subcommandsrMr[rr�)rLr?rr�rr�r-rJr�r��_get_positional_actionsrrjrfr^rvr&r)) r!r�r5rrTr�rhZ parsers_classrqr&r&r'�add_subparsers�s$   zArgumentParser.add_subparserscCs$|jr|jj|�n |jj|�|S)N)r�rKr)rJ)r!rqr&r&r'r)�s zArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr&)r�)rWrqr&r&r'rZ�sz8ArgumentParser._get_optional_actions.<locals>.<listcomp>)r)r!r&r&r'�_get_optional_actions�sz$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr&)r�)rWrqr&r&r'rZ�sz:ArgumentParser._get_positional_actions.<locals>.<listcomp>)r)r!r&r&r'rN�sz&ArgumentParser._get_positional_actionscCs4|j||�\}}|r0td�}|j|dj|��|S)Nzunrecognized arguments: %srx)r�rr?r )r!rYr1rDr�r&r&r'� parse_args�s zArgumentParser.parse_argsc Cs |dkrtjdd�}nt|�}|dkr.t�}x>|jD]4}|jtk r6t||j�s6|jtk r6t ||j|j�q6Wx*|j D] }t||�svt |||j |�qvWy<|j ||�\}}t|t �r�|j t|t ��t|t �||fStk �rtj�d}|jt|��YnXdS)NrP)r�rDr�r rr�rr�r�r0r�_parse_known_argsr�r�r/�delattrr�exc_infor?r�)r!rYr1rqr��errr&r&r'r��s,         zArgumentParser.parse_known_argscs"� jdk r� j���i�x`� jD]V}|j}xJt|j�D]<\}}�j|g�}|j|d|��|j||dd��q6Wq Wi�g}t��} xnt| �D]b\}} | dkr�|jd�xF| D]} |jd�q�Wq�� j | �} | dkr�d} n | �|<d} |j| �q�Wdj |��t ��t ��d����� fdd� � ����� � fd d �} � j ������ � fd d �}g�d � ��rpt ��}nd}x|� |k�r�t� fdd��D��}� |k�r�|� �}|� k�r�|� �qvn|� � �k�r�� |�}�j|�|� | � �� �qvW|� �}�j�|d��g}x�� jD]|}|�k�r|j�r>|jt|��nT|jdk �rt|jt��rt�|j��r|jt�|j�k�rt�|j� j||j���qW|�r�� jtd�dj |��xb� jD]X}|j�r�xH|jD]}|�k�r�P�q�Wdd�|jD�}td�}� j|dj |���q�W��fS)NrPz--r�A�Or[cs��j|��j||�}||jk rf�j|�x:�j|g�D]*}|�kr8td�}t|�}t|||��q8W|tk r||��||�dS)Nznot allowed with argument %s)r�� _get_valuesr�r�rr�rr)rqZargument_stringsr�Zargument_valuesZconflict_actionr�Z action_name)�action_conflictsr1� seen_actions�seen_non_default_actionsr!r&r'� take_actions    z5ArgumentParser._parse_known_args.<locals>.take_actioncs��|}|\}}}�j}g}�x>|dkr>�j�|�|dS|dk �r||d�}�j}|dkr�|d|kr�|j|g|f�|d} | |d}|dd�p�d} �j} || kr�| |}| }ntd�} t|| |��n@|dkr�|d} |g}|j|||f�Pntd�} t|| |��q |d}�|d�}|||�}||} �|| �}|j|||f�Pq W|�sht�x |D]\}}}�|||��qnW| S)NrPrVrzignored explicit argument %r)�_match_argumentrrrrrrR)� start_index� option_tuplerqr�� explicit_argZmatch_argumentZ action_tuples� arg_countr*�charZnew_explicit_argZ optionals_mapr��stoprYr�Zselected_patterns)r"�arg_strings_pattern�extras�option_string_indicesr!r\r&r'�consume_optional3sP        z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsr�j}�|d�}|�|�}x8t�|�D]*\}}�|||�}||7}�||�q(W�t|�d��dd�<|S)N)�_match_arguments_partial�ziprk)r^Z match_partialZselected_patternZ arg_countsrqrarY)r"rdr�r!r\r&r'�consume_positionals�s  z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrcsg|]}|�kr|�qSr&r&)rWr�)r^r&r'rZ�sz4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %sz, cSsg|]}|jtk rt|��qSr&)rmrr�)rWrqr&r&r'rZ�sz#one of the arguments %s is requiredrx)Nr�)rG�_read_args_from_filesrr�r�r�r��iterr�_parse_optionalr r�rNr@r?rr�r�r�r�r�r�r�r/r0� _get_valuer?r)r!r"r1r6r�r�Z mutex_actionZ conflictsZarg_string_pattern_partsZarg_strings_iter� arg_stringr_�patternrgrjZmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ stop_indexZrequired_actionsrqr�r�r�r&) rYr"rdrer1rfr�rZr[r!r^r\r'rR�s�        J                 z ArgumentParser._parse_known_argscCs�g}x�|D]�}| s"|d|jkr.|j|�q ylt|dd���R}g}x2|j�j�D]"}x|j|�D]}|j|�qdWqTW|j|�}|j|�WdQRXWq tk r�t j �d}|j t |��Yq Xq W|S)NrrP) rGrr��readr��convert_arg_line_to_argsrkr�rr�rTr?r�)r!r"Znew_arg_stringsroZ args_file�arg_liner#rUr&r&r'rk�s     z$ArgumentParser._read_args_from_filescCs|gS)Nr&)r!rsr&r&r'rr�sz'ArgumentParser.convert_arg_line_to_argscCst|j|�}tj||�}|dkrfdtd�ttd�ttd�i}tdd|j�|j}|j|j|�}t ||��t |j d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrP) �_get_nargs_patternrHr2rr r rr�r�rrkr�)r!rqrd� nargs_patternr2Z nargs_errorsr�r�r&r&r'r]s    zArgumentParser._match_argumentcstg}xjtt|�dd�D]V}|d|�}dj�fdd�|D��}tj||�}|dk r|jdd�|j�D��PqW|S)NrrPr[csg|]}�j|��qSr&)rt)rWrq)r!r&r'rZsz;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|] }t|��qSr&)rk)rWrr&r&r'rZ!sr�)r�rkr rHr2r�rh)r!rgrdr�r�Z actions_slicerpr2r&)r!r'rhs   z'ArgumentParser._match_arguments_partialc Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|jdd�\}}||jkr~|j|}|||fS|jr�|j|�}t|�dkr�djdd�|D��}||d�}td�}|j||�nt|�dkr�|\} | S|j j |��r|j �sdSd |k�rdSd|dfS) NrrP�=z, cSsg|]\}}}|�qSr&r&)rWrqr�r`r&r&r'rZGsz2ArgumentParser._parse_optional.<locals>.<listcomp>)r8Zmatchesz4ambiguous option: %(option)s could match %(matches)srx) rrrk�splitrI�_get_option_tuplesr rr?rr2r) r!rorqr�r`Z option_tuplesZoptionsrYr�r_r&r&r'rm's>              zArgumentParser._parse_optionalc Cs0g}|j}|d|kr~|d|kr~d|kr<|jdd�\}}n|}d}x�|jD],}|j|�rL|j|}|||f}|j|�qLWn�|d|ko�|d|k�r|}d}|dd�}|dd�} xr|jD]T}||kr�|j|}||| f}|j|�q�|j|�r�|j|}|||f}|j|�q�Wn|jtd�|�|S)NrrPrvr3zunexpected option string: %s)rrwr� startswithrr?r) r!r�r�r*Z option_prefixr`rqr�Zshort_option_prefixZshort_explicit_argr&r&r'rxbs8             z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nX|tkr"d}nJ|tkr0d}n<|tkr>d}n.|tkrLd}n |tkrZd}nddjd |�}|jr�|jdd �}|jd d �}|S) Nz(-*A-*)z(-*A?-*)z (-*[A-]*)z (-*A[A-]*)z([-AO]*)z (-*A[-AO]*)z(-*%s-*)z-*rVr[r) r�r rr rrr r�r:)r!rqr�rur&r&r'rt�s$  z!ArgumentParser._get_nargs_patternc sx�jttgkr2y|jd�Wntk r0YnX| rz�jtkrz�jrP�j}n�j}t |t �rx�j �|�}�j �|�n�| r��jt kr��j r��jdk r��j}n|}�j �|�n�t|�dkr�jdtgkr�|\}�j �|�}�j �|�n��jtk�r��fdd�|D�}nb�jtk�rD��fdd�|D�}�j �|d�n0��fdd�|D�}x|D]}�j �|��q^W|S)Nz--rPcsg|]}�j�|��qSr&)rn)rW�v)rqr!r&r'rZ�sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}�j�|��qSr&)rn)rWrz)rqr!r&r'rZ�srcsg|]}�j�|��qSr&)rn)rWrz)rqr!r&r'rZ�s)r�rrr3r;r r�r�r�r�r�rn� _check_valuerrk)r!rqr"r%rorzr&)rqr!r'rX�s>       zArgumentParser._get_valuesc Cs�|jd|j|j�}t|�s0td�}t|||��y ||�}Wn�tk r~t|jdt|j��}tt j �d�}t||��YnLt t fk r�t|jdt|j��}||d�}td�}t|||��YnX|S)Nrz%r is not callablerrP)rr%z!invalid %(type)s value: %(value)r) r rr'rrrr/rr�r�rTr(r;)r!rqror+r�r�r$rYr&r&r'rn�s   zArgumentParser._get_valuecCsF|jdk rB||jkrB|djtt|j��d�}td�}t|||��dS)Nz, )r%r�z3invalid choice: %(value)r (choose from %(choices)s))r�r �maprrr)r!rqr%rYr�r&r&r'r{ s zArgumentParser._check_valuecCs$|j�}|j|j|j|j�|j�S)N)r�rjrfrrr^)r!rTr&r&r'� format_usage s zArgumentParser.format_usagecCsx|j�}|j|j|j|j�|j|j�x:|jD]0}|j|j �|j|j�|j |j �|j �q0W|j|j �|j�S)N)r�rjrfrrrdrrr`r5rtr�rarEr^)r!rTZ action_groupr&r&r'r^ s        zArgumentParser.format_helpcCs|j|jd�S)N)rM)rFrM)r!r&r&r'r�0 szArgumentParser._get_formattercCs"|dkrtj}|j|j�|�dS)N)r�r�r�r})r!�filer&r&r'� print_usage6 szArgumentParser.print_usagecCs"|dkrtj}|j|j�|�dS)N)r�r�r�r^)r!r~r&r&r'r�; szArgumentParser.print_helpcCs |r|dkrtj}|j|�dS)N)r��stderr�write)r!r�r~r&r&r'r�@ szArgumentParser._print_messagercCs |r|j|tj�tj|�dS)N)r�r�r�r�)r!Zstatusr�r&r&r'r�I szArgumentParser.exitcCs0|jtj�|j|d�}|jdtd�|�dS)z�error(message: string) Prints a usage message incorporating the message to stderr and exits. If you override this in a subclass, it should not return -- it should either exit or raise an exception. )rMr�r3z%(prog)s: error: %(message)s N)rr�r�rMr�r)r!r�rYr&r&r'r?N s  zArgumentParser.error)NN)NN)N)N)N)rN)!rr,r-r.rrOrrOr)rPrNrQr�rRrkrrr]rhrmrxrtrXrnr{r}r^r�rr�r�r�r?r�r&r&)r�r'r1sP4  #w;,,4    )6r.� __version__�__all__� collectionsr�r�r��osr8�rerH�sysr��textwrapr�rrrrr rr rrr�r�rr2rrrrr r�� Exceptionrrr r�r�r�r�r�r�r�r�r�r�rr r r,r.rr&r&r&r'�<module>>s� n    [#%`65"