g#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 //opt/alt/python312/lib64/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 r4cl|xj|jzc_|xjdzc_yrbrdr:s r2_dedentzHelpFormatter._dedents'  6 66 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}n||sdt|jz}n|dt|jz}g}g}|D]1}|jr|j |!|j |3|j } | ||z|} dj || fD cgc]} | s|  c} }|j|jz t|t|zkDr1d} | ||} | ||}tj| | }tj| |}d 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)sb >y\F  Ddjj11E]74::!66E]$** 55DIK!(($$V,&&v. "//F!)k"96BLHH$ )=C)=Aa)=CDEt';';;J6{SZ'*4 #9f5 ";7 KK Y? KK Y? !,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|js8|j|}dj|j||dSg}|jdk(r|j |jnJ|j |}|j||}|jD]}|j|d|dj|S)Nrrcrr!) rrr*_metavar_formatterrrrrr&)r+rrrrrs r2rz'HelpFormatter._format_action_invocation4s$$>>vFG88DD33FGDQGH HE||q  V223 @@H"//@ %+%:%:MLLM;!GH&;99U# #r4c|j |jn;|j-ddjtt|jzn|fd}|S)N{%s},c4ttrSf|zSr6) isinstancetuple) tuple_sizeresults r2rz0HelpFormatter._metavar_formatter..formatSs&%( zJ..r4)metavarchoicesr*mapstr)r+rdefault_metavarrrs @r2rz HelpFormatter._metavar_formatterKsO >> %^^F ^^ 'chhs3'?@@F$F /  r4c|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_argsZs--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??Ecxtt||j}t|D]}||tus||=t|D]$}t ||ds||j ||<&|jd%djtt|d|d<|j||zS)Nrr$rr!) rtvarsrKr7rhasattrr$rr*rr_get_help_string)r+rparamsr0s r2rzHelpFormatter._expand_helpvsd6l4LDd|x'4L!LDvd|Z0%d|44t ! ::i , $ #c6)3D*E FF9 $$V,v55r4c#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.'`$. 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 c |y|jrdj|jS|jdtfvrm|j}t |t s|S|j tk(rt|dk(rd|zS|j tk(rd|zSdj|S|jdtfvr |jS|jr,ddjtt|jzSy)N/rFz%s[, %s]r!rr)rr*rrrrrrrrrrrr)argumentrs r2_get_action_namer2s  xx//00   $!1 1""'5)N >>\ )c'la.?' ' ^^{ *' '99W% % tX. .}}   S(*:*:!;<<<r4ceZdZdZdZdZy)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)r2 argument_namemessage)r+r1r6s r2r`zArgumentError.__init__s-h7 r4c~|jd}n td}|t|j|jzS)Nz %(message)sz'argument %(argument_name)s: %(message)s)r6r5)r5rsrtr6)r+rs r2__str__zArgumentError.__str__ sA    %"F@AFT\\+/+=+=?? ?r4N)r$r=r>r?r`r8r<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+rrrr=rr#rrrrs r2r`zAction.__init__QsK-          r4cLgd}|Dcgc]}|t||fc}Scc}w)Nr<getattrr+namesr0s r2r(zAction._get_kwargsgs/  9>>wtT*+>>>!c |jdSrA)rr:s r2rzAction.format_usagevs""1%%r4c*ttd)Nz.__call__() not defined)NotImplementedErrorrsr+parser namespacevaluesrs r2__call__zAction.__call__ys!!$=">??r4NNNNNFNNr6)r$r=r>r?r`r(rrKr<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)NrP)rsetattrrrTrGs r2rKzBooleanOptionalAction.__call__s3 D// / Ityym.F.Fw.O*O P 0r4c8dj|jS)Nz | )r*rr:s r2rz"BooleanOptionalAction.format_usageszz$--..r4r6)r$r=r>rVr`rKr __classcell__r\s@r2rrs(),,-`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<)rrrYrcr` r+rrrr=rr#rrrrr\s r2r`z_StoreAction.__init__ss A:KL L  (!2?(JK K lD*) + r4c2t||j|yr6)r^rrGs r2rKz_StoreAction.__call__s 499f-r4rLr6r$r=r>r`rKr`ras@r2rcrcs' :.r4rcc2eZdZ dfd ZddZxZS)_StoreConstActionc :tt| ||d||||y)Nr)rrrr=rrr)rYrjr` r+rrr=rrrrr\s r2r`z_StoreConstAction.__init__s/ /) 0 r4cFt||j|jyr6)r^rr=rGs r2rKz_StoreConstAction.__call__s 499djj1r4NNFNNr6rhras@r2rjrjs "2r4rjc&eZdZ dfd ZxZS)_StoreTrueActionc8tt| ||d|||y)NTrrr=rrr)rYrpr`r+rrrrrr\s r2r`z_StoreTrueAction.__init__s, .) / r4)FFNr$r=r>r`r`ras@r2rprps   r4rpc&eZdZ dfd ZxZS)_StoreFalseActionc8tt| ||d|||y)NFrr)rYrvr`rss r2r`z_StoreFalseAction.__init__s, /) 0 r4)TFNrtras@r2rvrvs   r4rvc8eZdZ 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 appropriaterer<)rrrYryr`rfs r2r`z_AppendAction.__init__ss A:OP P  (!2?(JK K mT+) , r4ct||jd}t|}|j|t ||j|yr6)r@rrCr&r^r+rHrIrJrr9s r2rKz_AppendAction.__call__4: 499d3E" V 499e,r4rLr6rhras@r2ryrys' :-r4ryc2eZdZ dfd ZddZxZS)_AppendConstActionc <tt| ||d|||||y)Nr)rrrr=rrrr)rYrr`rls r2r`z_AppendConstAction.__init__=s2  $0) 1 r4ct||jd}t|}|j|jt ||j|yr6)r@rrCr&r=r^r|s r2rKz_AppendConstAction.__call__Os> 499d3E" TZZ  499e,r4rnr6rhras@r2rr;s $-r4rc.eZdZ dfd ZddZxZS) _CountActionc8tt| ||d|||y)Nr)rrrrrr)rYrr`rss r2r`z_CountAction.__init__Xs+ lD*) + r4cnt||jd}|d}t||j|dzy)Nrrc)r@rr^)r+rHrIrJrcounts r2rKz_CountAction.__call__fs2 499d3 =E 499eai0r4)NFNr6rhras@r2rrVs  1r4rc.eZdZeedffd ZddZxZS) _HelpActionNc6tt| |||d|y)Nrrrrrr)rYrr`)r+rrrrr\s r2r`z_HelpAction.__init__os( k4)) * r4cD|j|jyr6) print_helpexitrGs r2rKz_HelpAction.__call__{s r4r6r$r=r>rr`rKr`ras@r2rrms! r4rc0eZdZdeedffd ZddZxZS)_VersionActionNc^| td}tt||||d|||_y)Nz&show program's version number and exitrr)rsrYrr`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+rHrIrJrrrks r2rKz_VersionAction.__call__s[,, ?nnG))+ 7#i335t{{C r4r6rras@r2rrs!  r4rcReZdZGddeZedddffd ZdZdZd dZ xZ S) _SubParsersActionceZdZfdZxZS)&_SubParsersAction._ChoicesPseudoActionc|x}}|r|ddj|zz }ttj|}|j g|||y)Nrr!)rrrr)r*rYr_ChoicesPseudoActionr`)r+r0aliasesrrrsupr\s r2r`z/_SubParsersAction._ChoicesPseudoAction.__init__sU! !Gd7TYYw%777)>>EC LLD!(  *r4rtras@r2rrs  * *r4rFNc ||_||_i|_g|_tt |||t|j|||y)N)rrrrrrr) _prog_prefix _parser_class_name_parser_map_choices_actionsrYrr`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_actionrHs 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))rrr^rKeyErrorr*rsrparse_known_argsrr9r_UNRECOGNIZED_ARGS_ATTRr@r) r+rHrIrJrrr-rvmsg subnamespacekeyr1s r2rKz_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 rKr`ras@r2rrs2*v*.<%Lr4rceZdZddZy) _ExtendActionNct||jd}t|}|j|t ||j|yr6)r@rrCrr^r|s r2rKz_ExtendAction.__call__r}r4r6)r$r=r>rKr<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!cr+s r2r"z$FileType.__call__..(s4eQ$**_eswaxzargument "-" with mode %r)filenameerrorz$can't open '%(filename)s': %(error)s)rrstdinbufferanyrrsrrrrrOSErrorr)r+stringrervr6s` r2rKzFileType.__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__7szz4==(t~~.4<<0HI994E4C3"9d3i4EAG2gb#!$*,S1223 :..99F2s B B#B )rrNN)r$r=r>r?r`rKr3r<r4r2rr s  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)r^)r+rr0s r2r`zNamespace.__init__JsD D$t -r4c\t|tstSt|t|k(Sr6)rr NotImplementedr)r+others r2__eq__zNamespace.__eq__Ns%%+! !DzT%[((r4c||jvSr6)r8)r+rs r2 __contains__zNamespace.__contains__Ssdmm##r4N)r$r=r>r?r`rrr<r4r2r r Cs .) $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+$)rYrr` descriptionargument_default prefix_charsconflict_handler _registriesregisterrcrjrprvryrrrrrr _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__Ys\ /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)rrSrs 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]^}|j|ur|}n||jj}|j|j}|jD]}|||< `|jD]#}|j||j|%y)Nz.cannot merge actions - two groups are named %r)titlerr)r)rrrsrr rrrr _containerr rrrr) r+rtitle_group_maprr group_maprcont mutex_groups r2_add_container_actionsz(_ActionsContainer._add_container_actionssp((E{{o-HI  !455+0OEKK ( ) --E{{/1/3/F/F++ % 1 1%*%;%;0G0= ,  ..$3EKK$@ &!/."99E9,&u'7'7'='=>;;<)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_kwargs;s !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_class]s'Hg.!!(FF;;r4cd|jz} t||S#t$r$td}t ||jzwxYw)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)rr@r rsr)r+handler_func_namers r2rz_ActionsContainer._get_handlerasV1D4I4II :4!23 3 :;FGo$=>>%=s A c|D]d\}}|jj||jj|d|jrJ|jj |fyr6)rrSrrrr)r+rr*rs r2_handle_conflict_resolvez*_ActionsContainer._handle_conflict_resolves^&9 !M6  ! ! ( ( 7  ' ' + +M4 @((  //7&9r4r6)r$r=r>r`rrrrrr r rrrrrrrrr,r.r`ras@r2rrWsc01j!C 5.1(f  *%*eZdZdfd ZfdZfdZfdZxZS)rc |j}|d|j|d|j|d|jtt |}|dd|i|||_g|_|j|_ |j|_ |j|_ |j|_ |j|_ |j|_y)Nrrrrr<)rrrrrYrr`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)rYrrrr&r+rr\s r2rz_ArgumentGroup._add_actions-~t8@ ""6* r4cbtt| ||jj |yr6)rYrrrrSr3s r2rz_ArgumentGroup._remove_actions& nd26: ""6*r4cZtjdtdt||i|S)Nz&Nesting argument groups is deprecated.rFcategory stacklevel)rWwarnDeprecationWarningrYr r+rvrr\s r2r z!_ArgumentGroup.add_argument_groups/ 4' w)4:6::r4NN)r$r=r>r`rrr r`ras@r2rrsO, +;;r4rc6eZdZdfd ZdZdZfdZxZS)r cHtt| |||_||_yr6)rYr r`rr)r+rrr\s r2r`z _MutuallyExclusiveGroup.__init__s! %t5i@  #r4c|jrtd}t||jj |}|j j ||S)Nz-mutually exclusive arguments must be optional)rrsrrrrr&)r+rrs r2rz#_MutuallyExclusiveGroup._add_actionsK ??CDCS/ !,,V4 ""6* r4cp|jj||jj|yr6)rrrrSrs r2rz&_MutuallyExclusiveGroup._remove_actions( &&v. ""6*r4cZtjdtdt||i|S)Nz0Nesting mutually exclusive groups is deprecated.rFr6)rWr9r:rYr r;s r2r z4_MutuallyExclusiveGroup.add_mutually_exclusive_groups/ >' w3TDVDDr4)F)r$r=r>r`rrr r`ras@r2r r s$ +EEr4r c eZdZdZddddgedddddddf fd ZdZdZd Zd Z d Z d$d Z d$d Z dZ dZdZdZdZdZdZdZdZd$dZd$dZdZdZdZdZdZdZd%dZd%d Zd%d!Z d&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__..identitysMr4r#rhrFrzshow this help message and exit)rrr)rYrr`_ospathbasenamerargvr\repilogformatter_classfromfile_prefix_charsadd_help allow_abbrev exit_on_errorr rs _positionals _optionals _subparsersrrrrrrr )r+r\rrrLparentsrMrrNrrrOrPrQ superinit add_grouprFdefault_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\rrrMrrOr?rAs r2r(zArgumentParser._get_kwargs.s/ 9>>wtT*+>>>rCc |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<)rTrrsrr#rr rRrr_get_positional_actionsrrrrzrrr) r+rrrrkrr parsers_classrs r2add_subparserszArgumentParser.add_subparsers<s:    'a(R&ST T .$t*5 f   7JJw-(89E **]D9K#66ukJD #00D  ::f  %++-I668K44F    K D&224::#    %"&"8"8y*"U 4#44T9jQOIt 95 6 KK +BC D I6 7$! % 3s8$$ %s"E E?E::E?c  !"#$%&jjijD]h}|j}t |jD]B\}}j |g}|j |d||j ||dzdDji"g} t} t | D]b\}} | dk(r*| jd| D]} | jd5j| } | d} n| "|<d} | j| ddj| t$t%d$%fd & !"&fd}j##&fd }g g!d }"r t"}nd }||krut"Dcgc] }||k\r| c}}|s||k7r||}||kDr|}:|}|"vr,||} j |!j |||}||}||kru|s||} j |dn j |d!j |ddj!!t !Dcgc] \}}|dk7s |c}}!j!dd|d }t !D]\}}|sn|dk7s|dz}d |< Dcgc]}|| c} g}j"D]}|$vs|j$r|jt'|/|j(ur t'|!}}t;d}t9d|dj|z fScc}wcc}}wcc}wcc}w)NrcrOrAOroc2 j| j||}|js|rQ j|j|gD]+}| vst d}t |}t |||z|tur | ||yy)Nznot allowed with argument %s)r _get_valuesrrrsr2rr) rargument_stringsrargument_valuesconflict_actionr action_nameaction_conflictsrI seen_actionsseen_non_default_actionsr+s r2 take_actionz5ArgumentParser._parse_known_args..take_actions   V $"..v7GHO$$(8(,,V4'7';';FB'GO&*BB >?&6&G +FC+4EFF (Hh.tYG/r4c |}t|dkDrLdj|Dcgc] \}}}}| c}}}}}||d}td}td||z|d\}}}}j} g} |*j |j d|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 | |zj d|dz}np| dk(r|dz}|g}| j |||fnNtd }t|||z|dz}|d}| ||} || z}||}| j |||fnh| D]\}}}||||Scc}}}}w) Nrcr!)rmatchesz4ambiguous option: %(option)s could match %(matches)srrtrsrozignored explicit argument %rr)rr*rsr_match_argumentr&rr) start_index option_tuplesrrsep explicit_argrDrvrmatch_argument action_tuples arg_countrchar optionals_mapstoprselected_patternsr-arg_strings_patternextrasextras_patternoption_string_indicesr+r~s r2consume_optionalz:ArgumentParser._parse_known_args..consume_optionals2+>M=!A%))DQ%SDQ@ sL&3DQ%ST"-k":wONO#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$*=>*11#6#.?D!#a*Q ,~%,,fdM-JK  >?+FC,4FGG (!OE(;EF(C% .v7H II 9,D&uT2D!((&$ )FGIR0=+mFD-80=Ko%SsG9c j}|d}| |}t |D]\}}|||z}|jtk(r|dk(rO|j dn=|jt k7r*j d|||zdk\r|j d||z } || t|d dd|S)NrrOr)_match_arguments_partialziprrrSrfindr) r match_partialselected_pattern arg_countsrrrvr-rrr+r~s r2consume_positionalsz=ArgumentParser._parse_known_args..consume_positionalsIs 99M2;<@ &{4DEJ&)j%A! "; i0GH<<6)*;73> D)\\Y.+00k1?u #&5  H H(] ] B224   : &)*?&@ #&( #44(+2,)2EK'2,)(* $+1I"I(;K(H%);6"7K"7K"77%k2JK g&%%&9+F^&_`6 +;7K744:,[9J MM+jk2 3 MM+kl3 4  ! !"5kl"C DWW^4N*-V^)DQ)DAS1)DQK"0"8"8b"A ,Q/J!.11!8!OJ $F1I 2 "(9A1=a9FmmF\)??$++,>37 6;;7')V[[*II 6;; $ GI$ a(R&Syy!12'34 444E~~#22F!993,1+?+?=+? & 8 ;.f5+?=ABC'cCHHUO.CDD5&  s,)LR:D=s$Q&, Q+:Q+Q1Q1$Q6c 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)rNr&rrgetfilesystemencodinggetfilesystemencodeerrorsreadr$convert_arg_line_to_argsrrrrr)r+r-new_arg_stringsr args_filearg_liner/rqs 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)Nrrrort)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_optional s !} 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)rrPrrrTr&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/|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)rrrr=rrrrr _check_valuerrrr)r+rr-r1rvs r2rvzArgumentParser._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#rrsrrrrrr@r') r+rrrrrrqr0rvs r2rzArgumentParser._get_value s&&vv{{FKKH  "()Ci8 8 4z*F ! -c(C, ,:& 46;; D4EFD :6D78Cd 3 3  4sA C!A88ACc|j}|ot|tr t|}||vrOt|dj t t|jd}t d}t|||zyy)Nr!)r1rz3invalid choice: %(value)r (choose from %(choices)s))rrrrr*rrsr)r+rr1rrvrs r2rzArgumentParser._check_value sx..  '3'w-G#!$U#'99Sfnn-E#FHMN#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)rrrrrrrrrrrrrrLrz)r+rk action_groups r2rzzArgumentParser.format_help s'')  DJJ  ;; = 4++,!//L  # #L$6$6 7   |77 8  # #L$?$? @  ! ! # 0 4;;'$$&&r4c:|j|jS)Nr)rMr\r:s r2rzArgumentParser._get_formatter/ s###33r4ch|tj}|j|j|yr6)rrrrr+files r2 print_usagezArgumentParser.print_usage5 s) <;;D D--/6r4ch|tj}|j|j|yr6)rrrrzrs r2rzArgumentParser.print_help: s) <;;D D,,.5r4c|r'|xstj} |j|yy#ttf$rYywxYwr6)rstderrwriter r)r+r6rs r2rzArgumentParser._print_message? sB &4;;D  7# #G,  s +==cr|r |j|tjtj|yr6)rrrr)r+statusr6s r2rzArgumentParser.exitJ 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\r6rFz%(prog)s: error: %(message)s N)rrrr\rrs)r+r6rvs r2rzArgumentParser.errorO s= % g6 !Q784?@r4r<r6)rN)$r$r=r>r?rr`r(r_rrcr]rirrmrorrrrrrrrrrvrrrrzrrrrrrr`ras@r2rrs,!!.!'+"&")"#=0D ?>* .J$Lg!R 6#,",0\*X(\I*1f2 8' '.4 7 6  Ar4r)4r? __version____all__osrHrerWsysrrWrrsrrrrrrrrrrrCrr r rr r2 Exceptionrrr rVrrcrjrprvryrrrrrrrr rrr rr<r4r2rs;z  ,*      . v> "DFDNQ-Q!6!M: $} $&.?I?(  \@ \@@h6/F6/r .6 .F22.(")"#-F#-L--6161.&&V8cLcLJ-M-1:v1:n$ $(v8v8r ';&';TEnE8DA%'8DAr4