2g|dZdZgdZddlZddlZddlZddl Z ddl m Z m Z dZ dZdZd Zd Zd Zd ZGd deZdZGddeZGddeZGddeZGddeZGddeZdZGddeZGddeZGdd eZ eZ!Gd!d"e Z"Gd#d$e Z#Gd%d&e Z$Gd'd(e$Z%Gd)d*e$Z&Gd+d,e Z'Gd-d.e Z(Gd/d0e Z)Gd1d2e Z*Gd3d4e Z+Gd5d6e Z,Gd7d8e'Z-Gd9d:eZ.Gd;deZ0Gd?d@e0Z1GdAdBe1Z2GdCdDee0Z3y)Ea 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 ArgumentErrorArgumentTypeErrorBooleanOptionalActionFileType HelpFormatterArgumentDefaultsHelpFormatterRawDescriptionHelpFormatterRawTextHelpFormatterMetavarTypeHelpFormatter NamespaceAction ONE_OR_MOREOPTIONALPARSER REMAINDERSUPPRESS ZERO_OR_MOREN)gettextngettextz ==SUPPRESS==?*+zA......_unrecognized_argsc"eZdZdZdZdZdZy)_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__. ct|j}g}i}|jD]}|jt ||j D]1\}}|j r|j|d|-|||<3|r|jdt |z|ddj|dS)N=z**%s(, ))type__name__ _get_argsappendrepr _get_kwargs isidentifierjoin)self type_name arg_strings star_argsargnamevalues %/usr/local/lib/python3.12/argparse.py__repr__z_AttributeHolder.__repr__vsJ''   >>#C   tCy )$++-KD%  """dE#:;"' $ .    vY7 8$dii &<==cHt|jjSN)list__dict__itemsr+s r2r(z_AttributeHolder._get_kwargssDMM'')**r4cgSr6r:s r2r%z_AttributeHolder._get_argss r4N)r$ __module__ __qualname____doc__r3r(r%r<r4r2rrms >+r4rc`|gSt|tur|ddSddl}|j|SNr)r#r7copy)r9rBs r2 _copy_itemsrCs5 }  E{dQx 99U r4ceZdZdZ ddZdZdZGddeZdZ d Z d Z d Z d d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy)!rzFormatter 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. Nc|#ddl}|jj}|dz}||_||_t |t |dz |dz|_||_d|_ d|_ d|_ |j|d|_ |j|_tj dtj"|_tj d|_y)Nrz\s+z\n\n\n+)shutilget_terminal_sizecolumns_prog_indent_incrementminmax_max_help_position_width_current_indent_level_action_max_length_Section _root_section_current_section_recompileASCII_whitespace_matcher_long_break_matcher)r+progindent_incrementmax_help_positionwidthrHs r2__init__zHelpFormatter.__init__s = ,,.66E QJE !1"%&7&)%"*6F6J&K#M   "#!]]46 $ 2 2#&;;vsyy#A #&;;z#: r4cl|xj|jz c_|xjdz c_yNrQrLrRr:s r2_indentzHelpFormatter._indents'  6 66 q r4c|xj|jzc_|jdk\sJd|xjdzc_y)NrzIndent decreased below 0.rcrdr:s r2_dedentzHelpFormatter._dedentsA  6 66##q(E*EE( q r4ceZdZddZdZy)HelpFormatter._SectionNc<||_||_||_g|_yr6) formatterparentheadingr9)r+rkrlrms r2r`zHelpFormatter._Section.__init__s&DN DK"DLDJr4c |j|jj|jj}||jDcgc] \}}|| c}}}|j|jj |sy|j turM|j A|jj}tdt|j z}d|d|fz}nd}|d||dgScc}}w)Nz %(heading)s:)rm%*s%s  ) rlrkre _join_partsr9rgrmrrQ_dict)r+r*funcargs item_helpcurrent_indent heading_textrms r2 format_helpz"HelpFormatter._Section.format_helps{{&&&(>>--DDJJGJjdDdDkJGHI{{&&&(||8+ 0H!%!?!? 04 3MM #~r<&HHw 489 9#HsC; r6)r$r=r>r`rzr<r4r2rTris    :r4rTcR|jjj||fyr6)rVr9r&)r+rurvs r2 _add_itemzHelpFormatter._add_items  ##**D$<8r4c|j|j||j|}|j|jg||_yr6)rerTrVr|rz)r+rmsections r2 start_sectionzHelpFormatter.start_sections? --d&;&;WE w**B/ 'r4cZ|jj|_|jyr6)rVrlrgr:s r2 end_sectionzHelpFormatter.end_sections $ 5 5 < < r4cV|tur!||j|j|gyyyr6)rr| _format_text)r+texts r2add_textzHelpFormatter.add_texts- x D$4 NN4,,tf 5%5 r4cZ|tur#||||f}|j|j|yyr6)rr| _format_usage)r+usageactionsgroupsprefixrvs r2 add_usagezHelpFormatter.add_usages1  '661D NN4--t 4 !r4c|jtur|j}t|||jzg}|j |D]/}|j t|||jz1t|}t|j||_|j|j|gyyr6) helpr_format_action_invocationlenrQ_iter_indented_subactionsr&rNrSr|_format_action)r+actionget_invocationinvocation_lengths subaction action_lengths r2 add_argumentzHelpFormatter.add_arguments ;;h &";;N"%nV&<"=@T@T"T!U !;;FC "))#nY.G*H4K_K_*_`D 23M&)$*A*A*7'9D # NN4.. 9 'r4c4|D]}|j|yr6)r)r+rrs r2 add_argumentszHelpFormatter.add_argumentssF   f %r4c|jj}|r0|jjd|}|j ddz}|S)N rq)rUrzr[substrip)r+rs r2rzzHelpFormatter.format_helpsI!!--/ ++//=D::d#d*D r4c^dj|Dcgc]}|r |tur|c}Scc}w)Nro)r*r)r+ part_stringsparts r2rrzHelpFormatter._join_parts$s=ww$0:$0DD$8$0:; ;:s*c| td}||t|jz}nB||sdt|jz}n#| dt|jz}g}g}|D]1}|jr|j |!|j |3|j } | ||z|} dj || fD cgc]} | s|  c} }|j|jz t|t|zkDr]d} | ||} | ||}tj| | }tj| |}dj || k(sJdj ||k(sJd fd }t|t|zdzkr[dt|t|zdzz}|r'||g|z||}|j|||nw|r||g|z||}nf|g}nbdt|z}||z}|||}t|dkDr2g}|j||||j||||g|z}d j |}||d Scc} w) Nzusage: r\z%(prog)s z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cg}g}t|}|t|dz }n|dz }|D]d}|dzt|zkDr,|r*|j|dj|zg}|dz }|j||t|dzz }f|r#|j|dj|z| |d|d|d<|S)Nrcrr)rr&r*) partsindentrlinesline indent_lengthline_lenr text_widths r2 get_linesz.HelpFormatter._format_usage..get_linesYsED$'KM)#&v;?#01#4 %#a<#d)3j@T!LL#((4.)@A#%D'4q'8H D) CIM1 !& Vchhtn%<=)#(8MN#;a Lr4g?rcrqrr6) rsrtrKoption_stringsr&_format_actions_usager*rPrQrrWfindallextend)r+rrrrr\ optionals positionalsrformat action_usages part_regexp opt_usage pos_usage opt_parts pos_partsrrrrrs @r2rzHelpFormatter._format_usage)s >y\F  Ddjj11E]74::!66E]$** 55DIK!(($$V,&&v. "//F!)k"96BLHH$ )=C)=Aa)=CDEt';';;J6{SZ'*4 #9f5 ";7 KK Y? KK Y? xx *i777xx *i777!,v;T*dZ.?? CK#d)$;a$?@F )4&9*&))=)=%>"005%)=)==/0,"'"6"6%))&1!;;(2494#7 -?AY,Y)0  >> G+#ENd2N-0GEN'>#CLC/L+.GCL.2 G+#ENd2N-0GEN'>#CLC/L+.GCL"519c2%( 3SZ"7+IAv{{h& T";;q>S(KKN[[Q'3.KKA&**BB6J((9]*Aw#~$r(c/#Abz T"!' 5 5a 8 <<1$!..0D #DDVLG"&"3"3FG"DK&3[AD6+F!D=D T"[,`.A!!*E!AJ/xx%D%$43C%DEwwx$t4wwx%'5wwD%0#t<zz| O  xEsMM M  MMcd|vr|t|jz}t|j|jz d}d|jz}|j |||dzS)Nz%(prog)r rr)rtrKrNrPrQ _fill_text)r+rrrs r2rzHelpFormatter._format_texts`  $DJJ//Dt';';;R@ t+++tZ86AAr4c`t|jdz|j}t|j|z d}||j z dz }|j |}|js|j d|f}d|z}n {{&&M9C%OM < /&&L-GC'#-ML&&M9C%OM(L ;;6;;,,.))&1I!..y*E  Y,JqM)JJK&qrNDLLmR-F!FG+''- LL 77?I LL,,Y7 8@&&r4c|js-|j|}|j||d\}|Sg}|jdk(r|j |jnJ|j |}|j ||}|jD]}|j|d|dj|S)Nrcrrr!) rr_metavar_formatterrrrrr&r*)r+rrmetavarrrrs r2rz'HelpFormatter._format_action_invocation4s$$>>vFG?t..vw?BHGNE||q  V223 @@H"//@ %+%:%:MLLM;!GH&;99U# #r4c|j |jnE|j7|jDcgc] }t|}}ddj|zn|fd}|Scc}w)Nz{%s},c4ttrSf|zSr6) isinstancetuple) tuple_sizeresults r2rz0HelpFormatter._metavar_formatter..formatUs&%( zJ..r4)rchoicesstrr*)r+rdefault_metavarchoice choice_strsrrs @r2rz HelpFormatter._metavar_formatterLsf >> %^^F ^^ '5;^^D^63v;^KDchh{33F$F /  EsA'c|j||}|j d|dz}|S|jtk(r d|dz}|S|jtk(r$|d}t |dk(rd|z}|Sd|z}|S|jt k(r d|dz}|S|jt k(rd}|S|jtk(r d |dz}|S|jtk(rd }|S t|jDcgc]}d}}d j|||jz}|Scc}w#t$r td dwxYw) Nz%srcrrFz [%s [%s ...]]z[%s ...]z %s [%s ...]rz%s ...rozinvalid nargs valuer) rrrrrrrrrr TypeErrorrr*)r+rr get_metavarrrrsformatss r2rzHelpFormatter._format_args\s--foF << KN*F. -\\X %k!n,F* )\\\ )!!nG7|q (72" $g- \\[ ("[^3F \\Y &F \\V # A.F \\X %F  B).v||)<=) B !67TA Bs2D? D:D?:D??Ectt||j}t|D]}||tus||=t|D]$}t ||ds||j ||<&|jd0dj|dDcgc] }t|c}}||d<|j||zScc}w)Nrr$rr!) rtvarsrKr7rhasattrr$rr*r_get_help_string)r+rparamsr0c choices_strs r2rzHelpFormatter._expand_helpxsd6l4LDd|x'4L!LDvd|Z0%d|44t ! ::i ,))VI5F$G5FSV5F$GHK +F9 $$V,v55%HsCc#K |j}|j|Ed{|jy7#t$rYywxYwwr6)_get_subactionsrergAttributeError)r+rget_subactionss r2rz'HelpFormatter._iter_indented_subactionssN #33N LLN%' ' ' LLN (    s1A AAAA A A AAc|jjd|j}ddl}|j ||S)Nrr)rZrrtextwrapwrap)r+rr_rs r2rzHelpFormatter._split_liness9''++C6<<> }}T5))r4c|jjd|j}ddl}|j ||||S)Nrr)initial_indentsubsequent_indent)rZrrrfill)r+rr_rrs r2rzHelpFormatter._fill_textsF''++C6<<>}}T5,2/57 7r4c|jSr6)rr+rs r2rzHelpFormatter._get_help_string {{r4c6|jjSr6)destupperrs r2rz/HelpFormatter._get_default_metavar_for_optionals{{  ""r4c|jSr6)rrs r2rz1HelpFormatter._get_default_metavar_for_positionalrr4)rFNr6) r$r=r>r?r`rergobjectrTr|rrrrrrrzrrrrrrrrrrrrrrrrr<r4r2rrs#$#% ;> :6:@9 ( 65 :"&; _,BqfB.'`$0 8 6*7#r4rceZdZdZdZy)r zHelp 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. cXdjfd|jdDS)Nroc3(K|] }|z ywr6r<).0rrs r2 z9RawDescriptionHelpFormatter._fill_text..sP1Ov}1OsT)keepends)r* splitlines)r+rr_rs `r2rz&RawDescriptionHelpFormatter._fill_texts#wwP$1OPPPr4N)r$r=r>r?rr<r4r2r r s  Qr4r ceZdZdZdZy)r zHelp 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. c"|jSr6)r&)r+rr_s r2rz!RawTextHelpFormatter._split_liness  r4N)r$r=r>r?rr<r4r2r r s  !r4r ceZdZdZdZy)rzHelp 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. c|j}|d}d|vrF|jtur4ttg}|j s|j |vr|tdz }|S)a6 Add the default value to the option help message. ArgumentDefaultsHelpFormatter and BooleanOptionalAction when it isn't already present. This code will do that, detecting cornercases to prevent duplicates or cases where it wouldn't make sense to the end user. roz %(default)z (default: %(default)s))rrrrrrrrs)r+rrdefaulting_nargss r2rz.ArgumentDefaultsHelpFormatter._get_help_strings`{{ <D t #~~X-$,l#; ((FLLr?rr<r4r2rrs  r4rceZdZdZdZdZy)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. c.|jjSr6r#r$rs r2rz:MetavarTypeHelpFormatter._get_default_metavar_for_optional{{###r4c.|jjSr6r.rs r2rzr?rrr<r4r2r r s$$r4r c2|y|jrdj|jS|jdtfvr |jS|jdtfvr |jS|j r!ddj|j zdzSy)N/{r})rr*rrrr)arguments r2_get_action_namer6s  xx//00   $!1 1 tX. .}}   SXXh..//#55r4ceZdZdZdZdZy)rzAn 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. c2t||_||_yr6)r6 argument_namemessage)r+r5r:s r2r`zArgumentError.__init__s-h7 r4c~|jd}n td}|t|j|jzS)Nz %(message)sz'argument %(argument_name)s: %(message)s)r:r9)r9rsrtr:)r+rs r2__str__zArgumentError.__str__sA    %"F@AFT\\+/+=+=?? ?r4N)r$r=r>r?r`r<r<r4r2rrs ?r4rceZdZdZy)rz@An error from trying to convert a command line string to a type.N)r$r=r>r?r<r4r2rrsJr4rc<eZdZdZ ddZdZdZddZy) 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. Nc ||_||_||_||_||_||_||_||_| |_| |_ yr6 rrrconstrr#rrrr) r+rrrrArr#rrrrs r2r`zAction.__init__LsK-          r4cLgd}|Dcgc]}|t||fc}Scc}w)Nr@getattrr+namesr0s r2r(zAction._get_kwargsbs/  9>>wtT*+>>>!c |jdSrA)rr:s r2rzAction.format_usageqs""1%%r4c*ttd)Nz.__call__() not defined)NotImplementedErrorrsr+parser namespacevaluesrs r2__call__zAction.__call__ts!!$=">??r4NNNNNFNNr6)r$r=r>r?r`r(rrOr<r4r2r r s70j, ?&@r4r c:eZdZdeeddeffd ZddZdZxZS)rNFc bg} |D]>} | j| | jds&d| ddz} | j| @dD].} t| tust j | dd0|turd}|turd}|turd}t || |d|||||| y) N----no-rF)r#rrzP{name!r} is deprecated as of Python 3.12 and will be removed in Python {remove}.))remover) rrrrr#rrrr)r& startswithlocals_deprecated_defaultwarnings _deprecatedsuperr`) r+rrrr#rrrr_option_stringsr field_name __class__s r2r`zBooleanOptionalAction.__init__|s+M  " "= 1''- '-*; ; &&}5 ,9Jx #+>>$$2" $9 & &D ) )G ) )G *  r4cp||jvr(t||j|jd yy)NrT)rsetattrrrXrKs r2rOzBooleanOptionalAction.__call__s3 D// / Ityym.F.Fw.O*O P 0r4c8dj|jS)Nz | )r*rr:s r2rz"BooleanOptionalAction.format_usageszz$--..r4r6)r$r=r>rZr`rOr __classcell__r`s@r2rr{s(),,-`Q/r4rc8eZdZ dfd ZddZxZS) _StoreActionc |dk(r td||tk7rtdtztt|||||||||| |  y)Nrznargs 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@)rrr]rgr` r+rrrrArr#rrrrr`s r2r`z_StoreAction.__init__ss A:KL L  (!2?(JK K lD*) + r4c2t||j|yr6)rbrrKs r2rOz_StoreAction.__call__s 499f-r4rPr6r$r=r>r`rOrdres@r2rgrgs' :.r4rgc2eZdZ dfd ZddZxZS)_StoreConstActionc :tt| ||d||||y)Nr)rrrrArrr)r]rnr` r+rrrArrrrr`s r2r`z_StoreConstAction.__init__s/ /) 0 r4cFt||j|jyr6)rbrrArKs r2rOz_StoreConstAction.__call__s 499djj1r4NNFNNr6rlres@r2rnrns "2r4rnc&eZdZ dfd ZxZS)_StoreTrueActionc8tt| ||d|||y)NTrrrArrr)r]rtr`r+rrrrrr`s r2r`z_StoreTrueAction.__init__s, .) / r4)FFNr$r=r>r`rdres@r2rtrts   r4rtc&eZdZ dfd ZxZS)_StoreFalseActionc8tt| ||d|||y)NFrv)r]rzr`rws r2r`z_StoreFalseAction.__init__s, /) 0 r4)TFNrxres@r2rzrzs   r4rzc8eZdZ dfd ZddZxZS) _AppendActionc |dk(r td||tk7rtdtztt|||||||||| |  y)Nrznargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriaterir@)rrr]r}r`rjs r2r`z_AppendAction.__init__ss A:OP P  (!2?(JK K mT+) , r4ct||jd}t|}|j|t ||j|yr6)rDrrCr&rbr+rLrMrNrr9s r2rOz_AppendAction.__call__/: 499d3E" V 499e,r4rPr6rlres@r2r}r}s' :-r4r}c2eZdZ dfd ZddZxZS)_AppendConstActionc <tt| ||d|||||y)Nr)rrrrArrrr)r]rr`rps r2r`z_AppendConstAction.__init__8s2  $0) 1 r4ct||jd}t|}|j|jt ||j|yr6)rDrrCr&rArbrs r2rOz_AppendConstAction.__call__Js> 499d3E" TZZ  499e,r4rrr6rlres@r2rr6s $-r4rc.eZdZ dfd ZddZxZS) _CountActionc8tt| ||d|||y)Nr)rrrrrr)r]rr`rws r2r`z_CountAction.__init__Ss+ lD*) + r4cnt||jd}|d}t||j|dzy)Nrrc)rDrrb)r+rLrMrNrcounts r2rOz_CountAction.__call__as2 499d3 =E 499eai0r4)NFNr6rlres@r2rrQs  1r4rc.eZdZeedffd ZddZxZS) _HelpActionNc6tt| |||d|y)Nrrrrrr)r]rr`)r+rrrrr`s r2r`z_HelpAction.__init__js( k4)) * r4cD|j|jyr6) print_helpexitrKs r2rOz_HelpAction.__call__vs r4r6r$r=r>rr`rOrdres@r2rrhs! r4rc0eZdZdeedffd ZddZxZS)_VersionActionNc^| td}tt||||d|||_y)Nz&show program's version number and exitrr)rsr]rr`version)r+rrrrrr`s r2r`z_VersionAction.__init__}sA <=>D nd,) -   r4c|j}| |j}|j}|j||j|j t j |jyr6)r_get_formatterr_print_messagerz_sysstdoutr)r+rLrMrNrrrks r2rOz_VersionAction.__call__s[,, ?nnG))+ 7#i335t{{C r4r6rres@r2rr{s!  r4rcReZdZGddeZedddffd ZdZdZd dZ xZ S) _SubParsersActionceZdZfdZxZS)&_SubParsersAction._ChoicesPseudoActionc|x}}|r|ddj|zz }ttj|}|j g|||y)Nrr!)rrrr)r*r]r_ChoicesPseudoActionr`)r+r0aliasesrrrsupr`s r2r`z/_SubParsersAction._ChoicesPseudoAction.__init__sU! !Gd7TYYw%777)>>EC LLD!(  *r4rxres@r2rrs  * *r4rFNc ||_||_i|_g|_tt |||t|j|||y)N)rrrrrrr) _prog_prefix _parser_class_name_parser_map_choices_actionsr]rr`r) r+rr\ parser_classrrrrr`s r2r`z_SubParsersAction.__init__sU!) " " /))) 0 r4c |jd|jd||d<|jdd}||jvrt |t d|z|D](}||jvst |t d|zd|vr?|jd}|j |||}|jj||jdi|}||j|<|D]}||j|<|S)Nr\rrr<zconflicting subparser: %szconflicting subparser alias: %sr) rrrrrrsrrr&r)r+r0kwargsraliasr choice_actionrLs r2 add_parserz_SubParsersAction.add_parsers ::f  %(,(9(94@F6N**Y+ 4(( (a(C&Dt&KL LE---#!=>FHH V ::f%D 55dGTJM  ! ! ( ( 7$##-f-&,d#E+1D ! !% ( r4c|jSr6)rr:s r2r z!_SubParsersAction._get_subactionss$$$r4c |d}|dd}|jturt||j| |j|}|j|d\} }t| jD]\} } t|| | |rAt|tst|tgt|tj|yy#t$r9|dj |jd}t d|z}t||wxYw)Nrrcr!) parser_namerz5unknown parser %(parser_name)r (choices: %(choices)s))rrrbrKeyErrorr*rsrparse_known_argsrr9r_UNRECOGNIZED_ARGS_ATTRrDr) r+rLrMrNrrr-rvmsg subnamespacekeyr1s r2rOz_SubParsersAction.__call__s Qi QRj  99H $ Ityy+ 6 +**;7F%+$;$;K$N! k|,224JC IsE *5 9&=> #:B? I6 7 > >{ K # +#.#yy)>)>?ADKLtSCc* *  +s C AD r6) r$r=r>r rrr`rr rOrdres@r2rrs2*v*.<%Lr4rceZdZddZy) _ExtendActionNct||jd}t|}|j|t ||j|yr6)rDrrCrrbrs r2rOz_ExtendAction.__call__rr4r6)r$r=r>rOr<r4r2rrs-r4rc$eZdZdZddZdZdZy)raFactory 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. Nc<||_||_||_||_yr6)_mode_bufsize _encoding_errors)r+modebufsizeencodingerrorss r2r`zFileType.__init__s  ! r4cF|dk(rdjvr8djvrtjjStjSt fddDr8djvrtj jStj St djz}t| t|jjjjS#t$r#}||d}t d}t||zd}~wwxYw) N-rbc3:K|]}|jvywr6)r)r#r r+s r2r$z$FileType.__call__..#s4eQ$**_eswaxzargument "-" with mode %r)filenameerrorz$can't open '%(filename)s': %(error)s)rrstdinbufferanyrrsrrrrrOSErrorr)r+stringrervr:s` r2rOzFileType.__call__s S=djj ,/4::,=tzz((M4::M4e44-0DJJ->t{{))ODKKO34tzzA o% 4 DMM4>> & & 4 &3D>?G#GdN3 3 4s=6C44 D =DD c L|j|jf}d|jfd|jfg}dj |Dcgc]}|dk7s t |c}|Dcgc]\}}||d|c}}z}t |jd|dScc}wcc}}w)Nrrr!rrr r")rrrrr*r'r#r$)r+rvrr/kwargs_strs r2r3zFileType.__repr__2szz4==(t~~.4<<0HI994E4C3"9d3i4EAG2gb#!$*,S1223 :..99F2s B B#B )rrNN)r$r=r>r?r`rOr3r<r4r2rrs  4(:r4rc"eZdZdZdZdZdZy)r zSimple object for storing attributes. Implements equality by attribute names and values, and provides a simple string representation. c 2|D]}t||||yr6)rb)r+rr0s r2r`zNamespace.__init__EsD D$t -r4c\t|tstSt|t|k(Sr6)rr NotImplementedr)r+others r2__eq__zNamespace.__eq__Is%%+! !DzT%[((r4c||jvSr6)r8)r+rs r2 __contains__zNamespace.__contains__Nsdmm##r4N)r$r=r>r?r`rrr<r4r2r r >s .) $r4r ceZdZfdZdZddZdZdZdZdZ dZ d Z d Z d Z d Zd ZddZdZdZdZdZxZS)_ActionsContainerc@tt| ||_||_||_||_i|_|jddt|jddt|jddt|jddt|jddt|jddt|jddt|jddt|jdd t |jdd t"|jdd t$|jdd t&|j)g|_i|_g|_g|_i|_t5j6d |_g|_y)Nrstore store_const store_true store_falser& append_constrrrparsersrz^-\d+$|^-\d*\.\d+$)r]rr` descriptionargument_default prefix_charsconflict_handler _registriesregisterrgrnrtrzr}rrrrrr _get_handler_actions_option_string_actions_action_groups_mutually_exclusive_groups _defaultsrWrX_negative_number_matcher_has_negative_number_optionals)r+rrrrr`s r2r`z_ActionsContainer.__init__Ts\ /1& 0( 0 hl3 h6 h /@A h .>? h /@A h-8 h0BC h6 h 4 h >: h +<= h-8  &(#!*,'), 4I(J%/1+r4cF|jj|i}|||<yr6)r setdefault)r+ registry_namer1rregistrys r2rz_ActionsContainer.registers###..}bA r4c@|j|j||Sr6)rr)r+rr1rs r2 _registry_getz_ActionsContainer._registry_gets  .225'BBr4c |jj||jD]%}|j|vs||j|_'yr6)rupdaterrr)r+rrs r2 set_defaultsz_ActionsContainer.set_defaultss@ f%mmF{{f$!' !4$r4c|jD],}|j|k(s|j |jcS|jj |dSr6)rrrrr)r+rrs r2 get_defaultz_ActionsContainer.get_defaultsHmmF{{d"v~~'A~~%$~~!!$--r4c|j}|rt|dk(r.|dd|vr$|rd|vr td|j|i|}n|j|i|}d|vrA|d}||j vr|j ||d<n|j |j |d<|j|}t|std|d|di|}|jd |j|j}t|st|d |turt|d t|d r! |jj|d|j!|S#t$r td wxYw)z add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...) rcrrz+dest supplied twice for positional argumentrNzunknown action ""r#z is not callablez: is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargsr<)rrr_get_positional_kwargs_get_optional_kwargsrr_pop_action_classcallablerr#rrrrr _add_action)r+rvrcharsr action_classr type_funcs r2rz_ActionsContainer.add_arguments!!s4yA~$q'!*E*A&( !NOO0T00$A&AF/T..??F F "&>Dt~~%$(NN4$8y!&&2$($9$9y!--f5  %lDE E''&&vv{{FKKH  "Y@A A  2;>? ? 4) * Q##%2264@'' Q !OPP Qs 8 E))E>cZt|g|i|}|jj||Sr6)_ArgumentGrouprr&)r+rvrrs r2add_argument_groupz$_ActionsContainer.add_argument_groups/t5d5f5 ""5) r4c Tt|fi|}|jj||Sr6)_MutuallyExclusiveGrouprr&)r+rrs r2add_mutually_exclusive_groupz._ActionsContainer.add_mutually_exclusive_groups*'77 ''..u5 r4cV|j||jj|||_|jD]}||j |<|jD]F}|j j|s|jr,|jjdH|S)NT) _check_conflictrr& containerrrrmatchr)r+rrs r2rz_ActionsContainer._add_actions V$ V$$22M9?D ' ' 63$22M,,22=A::77>>tD3  r4c:|jj|yr6)rrWrs r2_remove_actionz _ActionsContainer._remove_actions V$r4ci}|jD]B}|j|vr#td}t||jz|||j<Di}|jD]r}|j|vr?|j |j|j |j ||j<|jD]}||j||<t|jD]4}|j|j}|jD]}|||< 6|jD]#}|j||j|%y)Nz.cannot merge actions - two groups are named %r)titlerr)r)rrrsrr rrrrrrrrr)r+rtitle_group_maprr group_mapr mutex_groups r2_add_container_actionsz(_ActionsContainer._add_container_actionssG((E{{o-HI  !455+0OEKK ( ) --E{{/1/3/F/F++ % 1 1%*%;%;0G0= ,  ..$3EKK$@ &!/."99E;;<)K ..$/ &!/ : ((F MM&$ ' 3 3F ;)r4c d|vrtd}t||jd}|ttt t dfvrd|d<t||gS)Nrz1'required' is an invalid argument for positionalsrrTrr)rsrrrrrrrt)r+rrrrs r2rz(_ActionsContainer._get_positional_kwargs#s]  GHCC.  7# <HaH H!%F: Fb99r4cg}g}|D]~}|d|jvr(||jd}td}t||z|j|t |dkDs\|d|jvsn|j||j dd}|U|r|d}n|d}|j |j}|std}t|z|jdd}t||| S) Nr)optionrzNinvalid option string %(option)r: must start with a character %(prefix_chars)rrcrz%dest= is required for options like %rrrsr) rrsrr&rrlstripreplacert) r+rvrrlong_option_stringsrrrdest_option_strings r2rz&_ActionsContainer._get_optional_kwargs2s !M #t'8'88"/(,(9(9;GH t,,  ! !- 0=!A%-*:d>O>O*O#**=9"zz&$' <"%8%;"%3A%6"%,,T->->?D?@ }!455<<S)DFnEEr4cL|jd|}|jd||S)Nr)rr)r+rrrs r2rz#_ActionsContainer._pop_action_classTs'Hg.!!(FF;;r4cd|jz} t||S#t$r$td}t ||jzwxYw)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)rrDrrsr)r+handler_func_namers r2rz_ActionsContainer._get_handlerXsV1D4I4II :4!23 3 :;FGo$=>>%=s A c|D]d\}}|jj||jj|d|jrJ|jj |fyr6)rrWrrrr)r+rr+rs r2_handle_conflict_resolvez*_ActionsContainer._handle_conflict_resolvexs^&9 !M6  ! ! ( ( 7  ' ' + +M4 @((  //7&9r4r6)r$r=r>r`rrrrrr rrrrrrrrrr-r/rdres@r2rrRsc01j!C 5.1(f  *%&eZdZdfd ZfdZfdZfdZxZS)r c |j}|d|j|d|j|d|jtt |}|dd|i|||_g|_|j|_ |j|_ |j|_ |j|_ |j|_ |j|_y)Nrrrrr<)rrrrr]r r`rrrrrrrr)r+rrrrr super_initr`s r2r`z_ArgumentGroup.__init__s""!9#=#=>~y556!9#=#=>>49 5{5f5  %00!** &/&F&F#",,  4 4 +*3*N*N'r4cdtt| |}|jj ||Sr6)r]r rrr&r+rr`s r2rz_ArgumentGroup._add_actions-~t8@ ""6* r4cbtt| ||jj |yr6)r]r rrrWr4s r2rz_ArgumentGroup._remove_actions& nd26: ""6*r4cZtjdtdt||i|S)Nz&Nesting argument groups is deprecated.rFcategory stacklevel)r[warnDeprecationWarningr]r r+rvrr`s r2r z!_ArgumentGroup.add_argument_groups/ 4' w)4:6::r4NN)r$r=r>r`rrr rdres@r2r r sO, +;;r4r c6eZdZdfd ZdZdZfdZxZS)rcHtt| |||_||_yr6)r]rr`r _container)r+rrr`s r2r`z _MutuallyExclusiveGroup.__init__s! %t5i@  #r4c|jrtd}t||jj |}|j j ||S)Nz-mutually exclusive arguments must be optional)rrsrr@rrr&)r+rrs r2rz#_MutuallyExclusiveGroup._add_actionsK ??CDCS/ !,,V4 ""6* r4cp|jj||jj|yr6)r@rrrWrs r2rz&_MutuallyExclusiveGroup._remove_actions( &&v. ""6*r4cZtjdtdt||i|S)Nz0Nesting mutually exclusive groups is deprecated.rFr7)r[r:r;r]rr<s r2rz4_MutuallyExclusiveGroup.add_mutually_exclusive_groups/ >' w3TDVDDr4)F)r$r=r>r`rrrrdres@r2rrs$ +EEr4rc eZdZdZddddgedddddddf fd ZdZdZd Zd Z d Z d#d Z d#d Z dZ dZdZdZdZdZdZdZd#dZd#dZdZdZdZdZdZdZd$dZd$dZd$d Zd%d!Z d"Z!xZ"S)&raKObject for parsing command line strings into Python objects. Keyword Arguments: - prog -- The name of the program (default: ``os.path.basename(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 - exit_on_error -- Determines whether or not ArgumentParser exits with error info when an error occurs NrrTc tt| }|||| | |0tjj t jd}||_||_ ||_ ||_ ||_ | |_ | |_| |_|j }|t#d|_|t#d|_d|_d}|j+dd|d|vrdn|d}|jr,|j-|dz|d zd zd t.t#d  |D];}|j1| |j2}|j2j5|=y#t6$rYJwxYw) N)rrrrrzpositional argumentsoptionsc|Sr6r<)rs r2identityz)ArgumentParser.__init__..identity sMr4r#rhrFrzshow this help message and exit)rrr)r]rr`_ospathbasenamerargvr\repilogformatter_classfromfile_prefix_charsadd_help allow_abbrev exit_on_errorr rs _positionals _optionals _subparsersrrrrrrr)r+r\rrrNparentsrOrrPrrrQrRrS superinit add_grouprHdefault_prefixrldefaultsr`s r2r`zArgumentParser.__init__sp.$8 k+#3#3 5 <88$$TYYq\2D   .%:"  (*++ %a(>&?@#AiL1  fdH-!$| 3a ==   s"N1$4V$;x89  ; F  ' ' / 0!++%%h/"  s5 E E+*E+cLgd}|Dcgc]}|t||fc}Scc}w)N)r\rrrOrrQrCrEs r2r(zArgumentParser._get_kwargs%s/ 9>>wtT*+>>>rGc |jtdtd|jdt |d|vsd|vrE|j dtd}|j dd}|j |||_n|j|_|jdk|j}|j}|j}|j|j||d|jj|d<|j!|d}|d d gi|}|jj#||S) Nz(cannot have multiple subparser argumentsrrr subcommandsr\rorrr<)rVrrsrr#rr rTrr_get_positional_actionsrrrrzrrr) r+rrrrkrr parsers_classrs r2add_subparserszArgumentParser.add_subparsers3s:    'a(R&ST T .$t*5 f   7JJw-(89E **]D9K#66ukJD #00D  ::f  %++-I668K44F    K D&224::#    %"&"8"8y"I 4#44T9EOIt 95 6 KK +BC D I6 7$! % 3s8$$ %s"E E=E88E=c F !"jjijD]h}|j}t |jD]B\}}j |g}|j |d||j ||dzdDjig}t} t | D]b\}dk(r*|jd| D]|jd5j} | d} n| |<d} |j| ddj|t t!d !fd ""fd} j"fd } gd }r t}nd }||kr_tDcgc] }||k\r| c}}||k7r| |}||kDr|}8|}|vr||}j ||}| |}||kr_| |}j |dg}jD]}| vs|j r|jt#|/|j$.take_actions   V $"..v7GHO$$(8(,,V4'7';';FB'GO&*BB >?&6&G +FC+4EFF (Hh.tYG/r4c |}t|dkDrIdj|Dcgc] \}}}}| c}}}}}|d}td}td||z|d\}}}}j} g} |j ||dzS|| |d} j } | dk(r|d| vr|dk7r|s|d| vrtd}t|||z| j |g|f|d} | |dz}j}||vr$||}|dd}|sdx}}n|dd k(rd }|dd}nd}nj | |z|dz}np| dk(r|dz}|g}| j |||fnNtd}t|||z|dz}|d}| ||} || z}||}| j |||fnE| sJ| D]\}}}||||Scc}}}}w) Nrcr!)rmatchesz4ambiguous option: %(option)s could match %(matches)srrqrozignored explicit argument %rr)rr*rsr_match_argumentr&rr) start_index option_tuplesrrsep explicit_argrFrvrmatch_argument action_tuples arg_countrchar optionals_mapstoprselected_patterns arg_stringr-arg_strings_patternextrasoption_string_indicesr+r|s r2consume_optionalz:ArgumentParser._parse_known_args..consume_optionals2+>M=!A%))DQ%SDQ@ sL&3DQ%ST",ANO#D#*557DQ7G 4FM3 "11NM>MM+k":;&?* + .vs ;I !--E!Q)!,E9(B.,q/U":"#$B"CC"/l8J"KK%,,fb--HI,Q/(,|A(> (,(C(C (M9%2=%AF+7+;L#/59 9l!-aC!7&)/;AB/? &("MM$*=>#.?D!#a*Q ,~%,,fdM-JK  >?+FC,4FGG (!OE(;EF(C% .v7H II 9,D&uT2D!((&$ )FGEL! =/<+mFD-80=Kk%SsGc j}|d}| |}t |D]\}}|||z}|jtk(r$|dk(rY|ddk(sJ|j dn=|jt k7r*j d|||zdk\r|j d||z } || t|d dd|S)NrrrS)_match_arguments_partialziprrrWrfindr) r match_partialselected_pattern arg_countsrrrvr-rrr+r|s r2consume_positionalsz=ArgumentParser._parse_known_args..consume_positionals;s 99M2;<@ &{4DEJ&)j%A! "; i0GH<<6)*;73>#Aw$. D)\\Y.+00k1?u #&5  H H([ [ ~224   : &)*?&@ #&( #44(+2,)2EK'2,)(* $66(;K(H%);6"7K"7K"77%k2JK g&6 +;7K544:)5   k*+./mmF\)??$++,>37 6;;7')V[[*II 6;; $ GI$ a(R&Syy!12'34 444E~~#22F!993,1+?+?=+? & 8 ;.f5+?=ABC'cCHHUO.CDD5&  M,)~=s N$Nc g}|D]}|r|d|jvr|j|( t|ddtjtj 5}g}|j jD])}|j|D]}|j|+|j|}|j|ddd|S#1swY xYw#t$r}tdt|d}~wwxYw)Nrrc)rr)rPr&rrgetfilesystemencodinggetfilesystemencodeerrorsreadr&convert_arg_line_to_argsrrrrr)r+r-new_arg_stringsr args_filearg_liner/ros r2rz$ArgumentParser._read_args_from_filess%JAd6P6P!P&&z2 8jn'+'A'A'C%)%C%C%EGJS&( (1(8(C(C(EH'+'D'DX'N + 2 23 7(O)F'+&@&@&M '..{;G&,GG8'c#h778s05C*#A/CC*C' #C** D 3DD c|gSr6r<)r+rs r2rz'ArgumentParser.convert_arg_line_to_argss zr4cx|j|}tj||}|xdtdttdt tdi}|j |j}|$tdd|j|jz}t||t|jdS)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrc) _get_nargs_patternrWrrsrrrrrrrr)r+rr nargs_patternr nargs_errorsrs r2rzArgumentParser._match_arguments//7  -)<= =a/0!;<Q?@L ""6<<0C{56%||-/5||< , ,5;;q>""r4c tt|ddD]}|d|}dj|Dcgc]}|j|c}}t j ||}|O|j Dcgc] }t|} }|jt|kr(||jdk(r| r| ds | d=| r| ds | cSgScc}wcc}w)Nrrrorr)rrr*rrWrrr) r+rrr actions_slicerrrrrs r2rz'ArgumentParser._match_arguments_partialss7|Q+A#BQKMgg-:<-:6 $66v>-:<=GIIg':;E 49LLNCN&#f+NCIIK#&9"::+EIIK8C? "2J! , <Ds C 8Cc|sy|d|jvry||jvr|j|}||ddfgSt|dk(ry|jd\}}}|r$||jvr|j|}||||fgS|j |}|r|S|j j |r |jsyd|vryd|ddfgS)Nrrcrr)rrr partition_get_option_tuplesrrr)r+rrrrrrs r2rzArgumentParser._parse_optionals !} 1 11 44 400? ?// ;   ( ( . .z :66 * z4.//r4cg}|j}|d|vry|d|vrr|jrd|jd\}}}|sdx}}|jD]:}|j |s|j|}||||f}|j |<|S|d|vr|d|vr|jd\}}}|sdx}}|dd} |dd} |jD]s}|| k(r'|j|}||d| f}|j |/|js<|j |sN|j|}||||f}|j |u|St dtd|z)NrrcrrFrozunexpected option string: %s)rrRrrrXr&rrs) r+rrr option_prefixrrrrshort_option_prefixshort_explicit_args r2rz!ArgumentParser._get_option_tuples s!!  u $q)9U)B  3@3J3J33O0 sL)--C,%)%@%@M$// >!%! -1  &=+;5+H/)F 6;;7 ' 6;; ? C1iPQ 6;;7 **F#)#4#4FL%+%8%8FN*224I 9(F+1??F(&+FO("<|jdtfvr*|\}|j||}|j|||S|jtk(r!|Dcgc]}|j||}}|S|jtk(r6|Dcgc]}|j||}}|j||d|S|jtk(rt}|S|Dcgc]}|j||}}|D]}|j|||Scc}wcc}wcc}w)Nrcr)rrrrArrrrr _check_valuerrrr)r+rr-r1rvs r2rtzArgumentParser._get_values sv||x7$$ %%%x*?6!!&%0P I&,,,">''~~)!!&%0@ 9$8 3  "v||h7G'G%KJOOFJ7E   fe ,, '\\Y &9DEAT__VQ/EE$ \\V #9DEAT__VQ/EE   feAh / \\X %E :EEAT__VQ/EE!!&!, %FFFs-G(!G-2G2c|jd|j|j}t|std}t |||z ||}|S#t $r}t |}t ||d}~wttf$rJt|jdt|j}||d}td}t |||zwxYw)Nr#z%r is not callabler$)r#r1z!invalid %(type)s value: %(value)r) rr#rrsrrrrrrDr') r+rrr rrror0rvs r2rzArgumentParser._get_value s&&vv{{FKKH  "()Ci8 8 4z*F ! -c(C, ,:& 46;; D4EFD :6D78Cd 3 3  4sA C!A88ACc|j}|ft|tr t|}||vrF|dj t t |jd}td}t|||zyy)Nr!)r1rz3invalid choice: %(value)r (choose from %(choices)s)) rrrrr*mapr'rsr)r+rr1rrvrs r2rzArgumentParser._check_value st..  '3'w-G#!&#'99Sv~~-F#GIMN#FC$J77 $ r4c|j}|j|j|j|j|j Sr6)rrrrrrz)r+rks r2rzArgumentParser.format_usage( sB'') DJJ  ;; =$$&&r4c|j}|j|j|j|j|j |j |jD]c}|j|j|j |j |j|j|je|j |j|jSr6)rrrrrrrrrrrrrrNrz)r+rk action_groups r2rzzArgumentParser.format_help. s'')  DJJ  ;; = 4++,!//L  # #L$6$6 7   |77 8  # #L$?$? @  ! ! # 0 4;;'$$&&r4c:|j|jS)Nr)rOr\r:s r2rzArgumentParser._get_formatterE s###33r4ch|tj}|j|j|yr6)rrrrr+files r2 print_usagezArgumentParser.print_usageK s) <;;D D--/6r4ch|tj}|j|j|yr6)rrrrzrs r2rzArgumentParser.print_helpP s) <;;D D,,.5r4c|r'|xstj} |j|yy#ttf$rYywxYwr6)rstderrwriterr)r+r:rs r2rzArgumentParser._print_messageU sB &4;;D  7# #G,  s +==cr|r |j|tjtj|yr6)rrrr)r+statusr:s r2rzArgumentParser.exit` s%     5 &r4c|jtj|j|d}|j dt d|zy)zerror(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. )r\r:rFz%(prog)s: error: %(message)s N)rrrr\rrs)r+r:rvs r2rzArgumentParser.errore s= % g6 !Q784?@r4r=r6)rN)#r$r=r>r?rr`r(rarrer_rkrrmrrrrrrrrrrtrrrrzrrrrrrrdres@r2rrs,!!.!'+"&")"#=0D ?>* .$LQ!f6#,",0\*X(\H!Z1f2 8' '.4 7 6  Ar4r)4r? __version____all__osrJrerWsysrr[rrsrrrrrrrrrrrCrr r rr r6 Exceptionrrr rZrrgrnrtrzr}rrrrrrrr rr rrr<r4r2rs;z  ,*      . v> "GFGTQ-Q!6!M: $} $& ?I?(  \@ \@@h6/F6/r .6 .F22.(")"#-F#-L--6161.&&V8cLcLJ-M-1:v1:n$ $(r8r8j ';&';TEnE8cA%'8cAr4