Qfx dZgdZddlZddlZddlZddlZddl m Z m Z dZ dZ dZdZd Zd Zd ZGd d eZdZGddeZGddeZGddeZGddeZGddeZdZGddeZGddeZGddeZeZ Gd d!eZ!Gd"d#eZ"Gd$d%eZ#Gd&d'e#Z$Gd(d)e#Z%Gd*d+eZ&Gd,d-eZ'Gd.d/eZ(Gd0d1eZ)Gd2d3eZ*Gd4d5eZ+Gd6d7e&Z,Gd8d9eZ-Gd:d;eZ.Gd<d=eZ/Gd>d?e/Z0Gd@dAe0Z1GdBdCee/Z2y)Dz1.1)ArgumentParser ArgumentErrorArgumentTypeErrorBooleanOptionalActionFileType HelpFormatterArgumentDefaultsHelpFormatterRawDescriptionHelpFormatterRawTextHelpFormatterMetavarTypeHelpFormatter NamespaceAction ONE_OR_MOREOPTIONALPARSER REMAINDERSUPPRESS ZERO_OR_MOREN)gettextngettextz ==SUPPRESS==?*+zA......_unrecognized_argsc eZdZ dZdZdZy)_AttributeHolderct|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__r3r(r%r<r4r2rrms >+r4rc`|gSt|tur|ddSddl}|j|SNr)r#r7copy)r9rAs r2 _copy_itemsrBs5 }  E{dQx 99U r4ceZdZ ddZdZdZGddeZdZdZ d Z d Z dd Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy) rNc|#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_positionwidthrGs r2__init__zHelpFormatter.__init__s = ,,.66E QJE !1"%&7&)%"*6F6J&K#M   "#!]]46 $ 2 2#&;;vsyy#A #&;;z#: r4cl|xj|jz c_|xjdz c_yNrPrKrQr:s r2_indentzHelpFormatter._indents'  6 66 q r4cl|xj|jzc_|xjdzc_yrarcr:s r2_dedentzHelpFormatter._dedents'  6 66 q r4ceZdZddZdZy)HelpFormatter._SectionNc<||_||_||_g|_yr6) formatterparentheadingr9)r+rjrkrls 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:)rl%*s%s  ) rkrjrd _join_partsr9rfrlrrP_dict)r+r*funcargs item_helpcurrent_indent heading_textrls r2 format_helpz"HelpFormatter._Section.format_helps{{&&&(>>--DDJJGJjdDdDkJGHI{{&&&(||8+ 0H!%!?!? 04 3MM #~r<&HHw 489 9#HsC; r6)r$r=r>r_ryr<r4r2rSrhs    :r4rScR|jjj||fyr6)rUr9r&)r+rtrus r2 _add_itemzHelpFormatter._add_items  ##**D$<8r4c|j|j||j|}|j|jg||_yr6)rdrSrUr{ry)r+rlsections r2 start_sectionzHelpFormatter.start_sections? --d&;&;WE w**B/ 'r4cZ|jj|_|jyr6)rUrkrfr: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+usageactionsgroupsprefixrus r2 add_usagezHelpFormatter.add_usages1  '661D NN4--t 4 !r4cn|jtur|j}||g}|j|D]}|j ||t t t|}||jz}t |j||_ |j|j|gyyr6) helpr_format_action_invocation_iter_indented_subactionsr&rMmaplenrPrRr{_format_action)r+actionget_invocation invocations subactioninvocation_length action_lengths r2 add_argumentzHelpFormatter.add_arguments ;;h &";;N)&12K!;;FC "">)#<=D!$C[$9 : -0D0DDM&)$*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 rp)rTryrZsubstrip)r+rs r2ryzHelpFormatter.format_helpsI!!--/ ++//=D::d#d*D r4c^dj|Dcgc]}|r |tur|c}Scc}w)Nrn)r*r)r+ part_stringsparts r2rqzHelpFormatter._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)Nrbrr)rr&r*) partsindentrlinesline indent_lengthline_lenr text_widths r2 get_linesz.HelpFormatter._format_usage..get_linesZsED$'KM)#&v;?#01#4 %#a<#d)3j@T!LL#((4.)@A#%D'4q'8H D) CIM1 !& Vchhtn%<=)#(8MN#;a Lr4g?rbrprr6) rrrsrJoption_stringsr&_format_actions_usager*rOrPrrVfindallextend)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)rsrJrMrOrP _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)Nrbrrr!) rr_metavar_formatterrrrrr&r*)r+rrmetavarrrrs r2rz'HelpFormatter._format_action_invocation5s$$>>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..formatVs&%( zJ..r4)rchoicesstrr*)r+rdefault_metavarchoice choice_strsrrs @r2rz HelpFormatter._metavar_formatterMsf >> %^^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%srbrrEz [%s [%s ...]]z[%s ...]z %s [%s ...]rz%s ...rnzinvalid nargs valuer) rrrrrrrrrr TypeErrorrr*)r+rr get_metavarrrrrformatss 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!) rsvarsrJr7rhasattrr$rr*r_get_help_string)r+rparamsr0c choices_strs r2rzHelpFormatter._expand_helpysd6l4LDd|x'4L!LDvd|Z0%d|44t ! ::i ,))VI5F$G5FSV5F$GHK +F9 $$V,v55%HsCc#K |j}|j|Ed{|jy7#t$rYywxYwwr6)_get_subactionsrdrfAttributeError)r+rget_subactionss r2rz'HelpFormatter._iter_indented_subactionssN #33N LLN%' ' ' LLN (    s1A AAAA A A AAc|jjd|j}ddl}|j ||S)Nrr)rYrrtextwrapwrap)r+rr^rs r2rzHelpFormatter._split_liness9''++C6<<> }}T5))r4c|jjd|j}ddl}|j ||||S)Nrr)initial_indentsubsequent_indent)rYrrrfill)r+rr^rrs r2rzHelpFormatter._fill_textsF''++C6<<>}}T5,2/57 7r4c|jSr6)rr+rs r2r zHelpFormatter._get_help_string {{r4c6|jjSr6)destupperrs r2rz/HelpFormatter._get_default_metavar_for_optionals{{  ""r4c|jSr6)rrs r2rz1HelpFormatter._get_default_metavar_for_positionalrr4)rENr6)r$r=r>r_rdrfobjectrSr{r~rrrrrryrqrrrrrrrrrrrr rrr<r4r2rrs#$#% ;> :6:@9 ( 65 :$&; _,BqfB.'`$0 8 6*7#r4rceZdZ dZy)r cXdjfd|jdDS)Nrnc3(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>rr<r4r2r r s  Qr4r ceZdZ dZy)r c"|jSr6)r')r+rr^s r2rz!RawTextHelpFormatter._split_liness  r4N)r$r=r>rr<r4r2r r s  !r4r ceZdZ dZy)rc |j}|d}d|vrF|jtur4ttg}|j s|j |vr|tdz }|S)Nrnz %(default)z (default: %(default)s))rrrrrrrrr)r+rrdefaulting_nargss r2r z.ArgumentDefaultsHelpFormatter._get_help_stringse {{ <D t #~~X-$,l#; ((FLLr r<r4r2rrs  r4rceZdZ dZdZy)r c.|jjSr6r#r$rs r2rz:MetavarTypeHelpFormatter._get_default_metavar_for_optional{{###r4c.|jjSr6r/rs r2rzrrr<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_namer7s  xx//00   $!1 1 tX. .}}   SXXh..//#55r4ceZdZ dZdZy)rc2t||_||_yr6)r7 argument_namemessage)r+r6r;s r2r_zArgumentError.__init__s-h7 r4c~|jd}n td}|t|j|jzS)Nz %(message)sz'argument %(argument_name)s: %(message)s)r;r:)r:rrrsr;)r+rs r2__str__zArgumentError.__str__sA    %"F@AFT\\+/+=+=?? ?r4N)r$r=r>r_r=r<r4r2rrs ?r4rceZdZ y)rN)r$r=r>r<r4r2rrsJr4rc:eZdZ ddZdZdZddZy)r Nc ||_||_||_||_||_||_||_||_| |_| |_ yr6 rrrconstrr#rrrr) r+rrrrBrr#rrrrs r2r_zAction.__init__MsK-          r4cLgd}|Dcgc]}|t||fc}Scc}w)NrAgetattrr+namesr0s r2r(zAction._get_kwargscs/  9>>wtT*+>>>!c |jdSr@)rr:s r2rzAction.format_usagers""1%%r4c*ttd)Nz.__call__() not defined)NotImplementedErrorrrr+parser namespacevaluesrs r2__call__zAction.__call__us!!$=">??r4NNNNNFNNr6)r$r=r>r_r(rrPr<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-rE)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)NrU)rsetattrrrYrLs r2rPzBooleanOptionalAction.__call__s3 D// / Ityym.F.Fw.O*O P 0r4c8dj|jS)Nz | )r*rr:s r2rz"BooleanOptionalAction.format_usageszz$--..r4r6)r$r=r>r[r_rPr __classcell__ras@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 constrA)rrr^rhr_ r+rrrrBrr#rrrrras r2r_z_StoreAction.__init__ss A:KL L  (!2?(JK K lD*) + r4c2t||j|yr6)rcrrLs r2rPz_StoreAction.__call__s 499f-r4rQr6r$r=r>r_rPrerfs@r2rhrhs' :.r4rhc2eZdZ dfd ZddZxZS)_StoreConstActionc :tt| ||d||||y)Nr)rrrrBrrr)r^ror_ r+rrrBrrrrras r2r_z_StoreConstAction.__init__s/ /) 0 r4cFt||j|jyr6)rcrrBrLs r2rPz_StoreConstAction.__call__s 499djj1r4NNFNNr6rmrfs@r2roros "2r4roc&eZdZ dfd ZxZS)_StoreTrueActionc8tt| ||d|||y)NTrrrBrrr)r^rur_r+rrrrrras r2r_z_StoreTrueAction.__init__s, .) / r4)FFNr$r=r>r_rerfs@r2rurus   r4ruc&eZdZ dfd ZxZS)_StoreFalseActionc8tt| ||d|||y)NFrw)r^r{r_rxs r2r_z_StoreFalseAction.__init__s, /) 0 r4)TFNryrfs@r2r{r{s   r4r{c8eZdZ 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 appropriaterjrA)rrr^r~r_rks r2r_z_AppendAction.__init__ss A:OP P  (!2?(JK K mT+) , r4ct||jd}t|}|j|t ||j|yr6)rErrBr&rcr+rMrNrOrr9s r2rPz_AppendAction.__call__0: 499d3E" V 499e,r4rQr6rmrfs@r2r~r~s' :-r4r~c2eZdZ dfd ZddZxZS)_AppendConstActionc <tt| ||d|||||y)Nr)rrrrBrrrr)r^rr_rqs r2r_z_AppendConstAction.__init__9s2  $0) 1 r4ct||jd}t|}|j|jt ||j|yr6)rErrBr&rBrcrs r2rPz_AppendConstAction.__call__Ks> 499d3E" TZZ  499e,r4rsr6rmrfs@r2rr7s $-r4rc.eZdZ dfd ZddZxZS) _CountActionc8tt| ||d|||y)Nr)rrrrrr)r^rr_rxs r2r_z_CountAction.__init__Ts+ lD*) + r4cnt||jd}|d}t||j|dzy)Nrrb)rErrc)r+rMrNrOrcounts r2rPz_CountAction.__call__bs2 499d3 =E 499eai0r4)NFNr6rmrfs@r2rrRs  1r4rc.eZdZeedffd ZddZxZS) _HelpActionNc6tt| |||d|y)Nrrrrrr)r^rr_)r+rrrrras r2r_z_HelpAction.__init__ks( k4)) * r4cD|j|jyr6) print_helpexitrLs r2rPz_HelpAction.__call__ws r4r6r$r=r>rr_rPrerfs@r2rris! r4rc0eZdZdeedffd ZddZxZS)_VersionActionNc^| td}tt||||d|||_y)Nz&show program's version number and exitrr)rrr^rr_version)r+rrrrrras r2r_z_VersionAction.__init__~sA <=>D nd,) -   r4c|j}| |j}|j}|j||j|j t j |jyr6)r_get_formatterr_print_messagery_sysstdoutr)r+rMrNrOrrrjs r2rPz_VersionAction.__call__s[,, ?nnG))+ 7#i335t{{C r4r6rrfs@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+r0aliasesrrrsupras r2r_z/_SubParsersAction._ChoicesPseudoAction.__init__sU! !Gd7TYYw%777)>>EC LLD!(  *r4ryrfs@r2rrs  * *r4rFNc ||_||_i|_g|_tt |||t|j|||y)N)rrrrrrr) _prog_prefix _parser_class_name_parser_map_choices_actionsr^rr_r) r+rr[ parser_classrrrrras 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) rrrrrrrrrr&r)r+r0kwargsraliasr choice_actionrMs 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 r2rz!_SubParsersAction._get_subactionss$$$r4c|d}|dd}|jturt||j| |j|}|j|d\} }t| jD]\} } t|| | |r?t|jtgt|tj|yy#t$r9|dj |jd}t d|z}t||wxYw)Nrrbr!) parser_namerz5unknown parser %(parser_name)r (choices: %(choices)s))rrrcrKeyErrorr*rrrparse_known_argsrr9 setdefault_UNRECOGNIZED_ARGS_ATTRrEr) r+rMrNrOrrr-rumsg subnamespacekeyr1s r2rPz_SubParsersAction.__call__s Qi QRj  99H $ Ityy+ 6 +**;7F%+$;$;K$N! k|,224JC IsE *5  O & &'> C I6 7 > >{ K # +#.#yy)>)>?ADKLtSCc* *  +s C AD r6) r$r=r>r rrr_rrrPrerfs@r2rrs2*v*.<%Lr4rceZdZddZy) _ExtendActionNct||jd}t|}|j|t ||j|yr6)rErrBrrcrs r2rPz_ExtendAction.__call__rr4r6)r$r=r>rPr<r4r2rrs-r4rc"eZdZ ddZdZdZy)rNc<||_||_||_||_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)rrstdinbufferanyrrrrrrrrOSErrorr)r+stringrerur;s` r2rPzFileType.__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+rurr/kwargs_strs r2r3zFileType.__repr__2szz4==(t~~.4<<0HI994E4C3"9d3i4EAG2gb#!$*,S1223 :..99F2s B B#B )rrNN)r$r=r>r_rPr3r<r4r2rrs  4(:r4rc eZdZ dZdZdZy)r c 2|D]}t||||yr6)rc)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_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 _registriesregisterrhrorur{r~rrrrrr _get_handler_actions_option_string_actions_action_groups_mutually_exclusive_groups _defaultsrVrW_negative_number_matcher_has_negative_number_optionals)r+rrrrras 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)rr)r+ registry_namer1r registrys 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|d i|}|jd|j|j}t|st|d |turt|d t|d r! |jj|d|j!|S#t$r td wxYw)Nrbrrz+dest supplied twice for positional argumentrzunknown 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+rurcharsr 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 9 E**E?cZt|g|i|}|jj||Sr6)_ArgumentGrouprr&)r+rurrs 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)rrXrs 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)rrrrrr 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||jdttfvrd|d<|jdtk(r d|vrd|d<t ||gS)Nrz1'required' is an invalid argument for positionalsrTrrr)rrrrrrrs)r+rrrs r2rz(_ActionsContainer._get_positional_kwargs#st  GHCC.  ::g x&> >!%F:  ::g , .9F3J!%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)rrbrz%dest= is required for options like %rrrrr) rrrrr&rrlstripreplacers) r+rurrlong_option_stringsrrrdest_option_strings r2rz&_ActionsContainer._get_optional_kwargs3s !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_classUs'Hg.!!(FF;;r4cd|jz} t||S#t$r$td}t ||jzwxYw)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)rrErrrr)r+handler_func_namers r2rz_ActionsContainer._get_handlerYsV1D4I4II :4!23 3 :;FGo$=>>%=s A c|D]d\}}|jj||jj|d|jrJ|jj |fyr6)rrXrrrr)r+rr,rs r2_handle_conflict_resolvez*_ActionsContainer._handle_conflict_resolveys^&9 !M6  ! ! ( ( 7  ' ' + +M4 @((  //7&9r4r6)r$r=r>r_rrrrrr rrrrrrrrrr.r0rerfs@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_initras 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+rras r2rz_ArgumentGroup._add_actions-~t8@ ""6* r4cbtt| ||jj |yr6)r^r rrrXr5s r2rz_ArgumentGroup._remove_actions& nd26: ""6*r4cZtjdtdt||i|S)Nz&Nesting argument groups is deprecated.rEcategory stacklevel)r\warnDeprecationWarningr^r r+rurras r2r z!_ArgumentGroup.add_argument_groups/ 4' w)4:6::r4NN)r$r=r>r_rrr rerfs@r2r r sO, +;;r4r c6eZdZdfd ZdZdZfdZxZS)rcHtt| |||_||_yr6)r^rr_r _container)r+rrras r2r_z _MutuallyExclusiveGroup.__init__s! %t5i@  #r4c|jrtd}t||jj |}|j j ||S)Nz-mutually exclusive arguments must be optional)rrrrrArrr&)r+rrs r2rz#_MutuallyExclusiveGroup._add_actionsK ??CDCS/ !,,V4 ""6* r4cp|jj||jj|yr6)rArrrXrs r2rz&_MutuallyExclusiveGroup._remove_actions( &&v. ""6*r4cZtjdtdt||i|S)Nz0Nesting mutually exclusive groups is deprecated.rEr8)r\r;r<r^rr=s r2rz4_MutuallyExclusiveGroup.add_mutually_exclusive_groups/ >' w3TDVDDr4)F)r$r=r>r_rrrrerfs@r2rrs$ +EEr4rc eZdZ ddddgedddddddf fd ZdZdZdZd Zd Z d"d Z d"d Z d Z dZ dZdZdZdZdZdZd"dZd"dZdZdZdZdZdZdZd#dZd#dZd#dZd$d Zd!Z xZ!S)%rNrrTc 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#rhrErzshow this help message and exit)rrr)r^rr__ospathbasenamerargvr[repilogformatter_classfromfile_prefix_charsadd_help allow_abbrev exit_on_errorr rr _positionals _optionals _subparsersrrrrrrr)r+r[rrrOparentsrPrrQrrrRrSrT superinit add_grouprIdefault_prefixrkdefaultsras 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[rrrPrrRrDrFs r2r(zArgumentParser._get_kwargs&s/ 9>>wtT*+>>>rHc |jtdtd|jdt |d|vsd|vrNt|j dd}t|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[rnrrr<)rWrrrrr#rr rUrr_get_positional_actionsrrrryrrr) r+rrrrjrr parsers_classrs r2add_subparserszArgumentParser.add_subparsers4s?    'a(R&ST T .$t*5 f   7fjj-89EFJJ}d;#    %"&"8"8y"I 4#44T9EOIt 95 6 KK +BC D I6 7$! % 3s8$$ %s"E E=E88E=c B !"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 fnn4(,,V4'7';';FB'GO&*BB >?&6&G +FC+4EFF (Hh.tYG/r4c|}|\}}}}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|ddk(rd}|dd}nd}nj| |z|dz} np|dk(r|dz} |g}|j|||fnNtd} t || |z|dz}|d}|||}||z} || }|j|||fnE|D]\}}}|||| S)Nrbrrrrnzignored explicit argument %rr)_match_argumentr&rrrrr) start_index option_tuplerrsep explicit_argmatch_argument action_tuples arg_countrrchar optionals_mapstoprurselected_patternsr-arg_strings_patternextrasoption_string_indicesr+r}s r2consume_optionalz:ArgumentParser._parse_known_args..consume_optionals,1=L7C 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!((&$ )FGEN0=+mFD-80=Kr4c j}|d}| |}t |D]\}}|||z}||z } || t|d dd|Sr6)_match_arguments_partialzipr) r match_partialselected_pattern arg_countsrrrur-rrr+r}s r2consume_positionalsz=ArgumentParser._parse_known_args..consume_positionals5s 99M2;<@ &{4DEJ&)j%A! "; i0GHy( FD)&B)Z)9:KN r4rrz(the following arguments are required: %sr!z#one of the arguments %s is requiredrr6)rQ_read_args_from_filesrrrrriterr&_parse_optionalr*rr`rMrLrrr7rrrrrrErc _get_valuerrrrr)#r+r-rNrrr mutex_action conflictsarg_string_pattern_partsarg_strings_iter arg_stringrpatternrrrmax_option_string_indexrnext_option_string_indexpositionals_end_indexstrings stop_indexrequired_actionsrrrGrrzrrrrr{r|r}s#``` @@@@@@@@r2rnz ArgumentParser._parse_known_argss  % % 144[AK::K'66M#,[-G-G#H<,77 bI   r!23  q1uv!67$I;!##%  ,&'78MAzT!(//4"2J,33C8#3 $33J? '!G/;)!,!G(//8#9(!gg&>?u #&5  H H*S S n224   ( &)*?&@ #&( #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)Nrrb)rr)rQr&rrgetfilesystemencodinggetfilesystemencodeerrorsreadr'convert_arg_line_to_argsrrrrr)r+r-new_arg_stringsr args_filearg_liner/rps 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 argumentsrb) _get_nargs_patternrVrrrrrrrrrrr)r+rr nargs_patternr nargs_errorsrs r2rzArgumentParser._match_arguments//7  -)<= =a/0!;<Q?@L ""6<<0C{56%||-/5||< , ,5;;q>""r4c \g}tt|ddD]}|d|}dj|Dcgc]}|j|c}}t j ||}|O|j |jD cgc] } t| c} |S|Scc}wcc} w)Nrrrn)rrr*rrVrrr) r+rrrr actions_slicerrrrs r2rz'ArgumentParser._match_arguments_partialss7|Q+A#BQKMgg-:<-:6 $66v>-:<=GIIg':;E  Hvs6{HI , <Is B$ B) c r|sy|d|jvry||jvr|j|}||ddfSt|dk(ry|jd\}}}|r#||jvr|j|}||||fS|j |}t|dkDrIdj |Dcgc] \}}}}| c}}}}}||d}t d} td| |zt|dk(r|\} | S|jj|r |jsyd|vryd|ddfScc}}}}w)Nrrbrr!)r matchesz4ambiguous option: %(option)s could match %(matches)sr) rrr partition_get_option_tuplesr*rrrrrr) r+rrrrr option_tuplesrGrurrs r2rzArgumentParser._parse_optionals!} 1 11 44 400!%!)F 6;;7 ' 6;; ? C1iPQ 6;;7 **F#)#4#4FL%+%8%8FN*224I 9(F+1??F(&+FO("<|jdt fvr*|\}|j||}|j|||S|jtk(r!|Dcgc]}|j||}}|S|jtk(r6|Dcgc]}|j||}}|j||d|S|jtk(rt}|S|Dcgc]}|j||}}|D]}|j|||S#t $rYwxYwcc}wcc}wcc}w)NrTrbr)rrrrrXrrrBrrrr _check_valuerrr)r+rr-r1rvs r2ruzArgumentParser._get_values s+$$fi=P)P ""4( v||x7$$ %%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!!&!, g  BFFFs#HH&H+ H0 H#"H#c|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#rrrrrrrrrEr') r+rrr rrrpr0rus r2rzArgumentParser._get_value s&&vv{{FKKH  "()Ci8 8 4z*F ! -c(C, ,:& 46;; D4EFD :6D78Cd 3 3  4sA C!A88ACc|jU||jvrF|djtt|jd}t d}t |||zyy)Nr!)r1rz3invalid choice: %(value)r (choose from %(choices)s))rr*rr'rrr)r+rr1rurs r2rzArgumentParser._check_value s^ >> %%v~~*E"#yyT6>>)BCEDIJCd 3 3 +F %r4c|j}|j|j|j|j|j Sr6)rrrrrry)r+rjs 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)rrrrrrrrr~rrrrrOry)r+rj action_groups r2ryzArgumentParser.format_help- s'')  DJJ  ;; = 4++,!//L  # #L$6$6 7   |77 8  # #L$?$? @  ! ! # 0 4;;'$$&&r4c:|j|jS)Nr)rPr[r:s r2rzArgumentParser._get_formatterD s###33r4ch|tj}|j|j|yr6)rrrrr+files r2 print_usagezArgumentParser.print_usageJ s) <;;D D--/6r4ch|tj}|j|j|yr6)rrrryrs r2rzArgumentParser.print_helpO s) <;;D D,,.5r4c|r'|xstj} |j|yy#ttf$rYywxYwr6)rstderrwriterr)r+r;rs r2rzArgumentParser._print_messageT 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)N)r[r;rEz%(prog)s: error: %(message)s )rrrr[rrr)r+r;rus r2rzArgumentParser.errord sB  % g6 !Q784?@r4r>r6)rN)"r$r=r>rr_r(rbrrfr`rlrrnrrrrrrrrrrurrrryrrrrrrrerfs@r2rrs,!!.!'+"&")"#=0D ?>* .$LA!F6#, 7,r(T+bH!Z8t24' '.4 7 6  Ar4r)3 __version____all__osrKrerVsysrr\rrrrrrrrrrrr rrBrr r rr r7 Exceptionrrr r[rrhrorur{r~rrrrrrrr rr rrr<r4r2rs;z  ,*      . v> "HFHVQ-Q!6!M: $} $& ?I?(  \@ \@@h6/F6/r .6 .F22.(")"#-F#-L--6161.&&V8bLbLH-M-1:v1:n$ $(s8s8l ';&';TEnE8aA%'8aAr4