a0biE SrSSKrSSKrSSKrSSKrSSKJrJr Sr\R"S\-5r \R"SR\\55r \ RSS 5r"S S 5rS r\R$Vs0sH n\"U5S _M snrSrSr"SS5r\S:Xa<SrSH3r\"S\-5 \"SR9\"\\555 \"5 M5 ggs snf)a6distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object N)DistutilsGetoptErrorDistutilsArgErrorz[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z ^({})=!({})$-_c\rSrSrSrSSjrSrSrSSjrSr S r S r S r S r S rSSjrSrSSjrSSjrSrg) FancyGetopt aWrapper around the standard 'getopt()' module that provides some handy extra functionality: * short and long options are tied together * options have help strings, and help text can be assembled from them * options set attributes of a passed-in object * boolean options can have "negative aliases" -- eg. if --quiet is the "negative alias" of --verbose, then "--quiet" on the command line sets 'verbose' to false NcXl0UlUR(aUR5 0Ul0Ul/Ul/Ul0Ul0Ul0Ul /Ul gN) option_table option_index _build_indexaliasnegative_alias short_opts long_opts short2long attr_name takes_arg option_orderselfr s ڛ/builddir/build/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/setuptools/_distutils/fancy_getopt.py__init__FancyGetopt.__init__,sk)        !  cURR5 URHnXRUS'M g)Nr)rclearr )roptions rrFancyGetopt._build_indexTs6 !''F+1  fQi ((rc0XlUR5 gr )r rrs rset_option_tableFancyGetopt.set_option_tableYs( rcXR;a[SU-5eXU4nURRU5 X@RU'g)Nz'option conflict: already an option '%s')rrr append)r long_option short_option help_stringr s r add_optionFancyGetopt.add_option]sQ ++ +&9KG "=F    $ $V ,-3  k *rcXR;$)z[Return true if the option table for this parser has an option with long name 'long_option'.)rrr's r has_optionFancyGetopt.has_optiongs////rc,UR[5$)zTranslate long option name 'long_option' to the form it has as an attribute of some object: ie., translate hyphens to underscores. translate longopt_xlater-s r get_attr_nameFancyGetopt.get_attr_namels$$]33rc [U[5(deUR5HSup4X0R;a[ SU<SU<SU<S35eX@R;dM=[ SU<SU<SU<S35e g)Nzinvalid z 'z ': option 'z ' not defined': aliased option ') isinstancedictitemsrr)raliaseswhatropts r_check_alias_dictFancyGetopt._check_alias_dictrss'4((((!--/JE---*UE++++*UC)*rc4URUS5 Xlg)z'Set the aliases for this option parser.rN)r>r)rrs r set_aliasesFancyGetopt.set_aliasess ug. rc4URUS5 Xlg)zSet the negative aliases for this option parser. 'negative_alias' should be a dictionary mapping option names to option names, both the key and value must already be defined in the option table.znegative aliasN)r>r)rrs rset_negative_aliases FancyGetopt.set_negative_aliasess ~/?@,rc/Ul/UlURR5 0UlUR GH5n[ U5S:XaUup#nSnO/[ U5S:XaUup#pEO[SRU55e[U[5(a[ U5S:a[SU-5eUb2[U[5(a[ U5S:Xd[S U-5eXPRU'URRU5 US S :Xa!U(aUS -nUSS nSURU'OcURRU5nUb6URU(a[S U<SU<S35eX RS 'SURU'UR RU5nUb4URUURU:wa[SU<SU<S35e["R%U5(d[SU-5eUR'U5UR(U'U(dGM URRU5 X RUS'GM8 g)zPopulate the various data structures that keep tabs on the option table. Called by 'getopt()' before it can do anything worthwhile. rzinvalid option tuple: {!r}z9invalid long option '%s': must be a string of length >= 2Nrz:invalid short option '%s': must a single character or None=:zinvalid negative alias 'r7z' takes a valuezinvalid alias 'z%': inconsistent with aliased option 'z/' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)rrrrrepeatr len ValueErrorformatr8strrr&rrgetr longopt_rematchr4r)rr longshorthelprMalias_tos r_grok_option_tableFancyGetopt._grok_option_tablesZ   ''F6{a$*!TV!,2)T6!!=!D!DV!LMMdC((CIM*S ] 5#(>(>3u:QR?*68=> !'KK  NN ! !$ 'Bx3!CKEAbz'(t$ ..2248'~~h/2CGS *.NN2&'(t$zz~~d+H#>>$'4>>(+CC.04X?##D))*>@DE $(#5#5d#;DNN4 u&&u-,0a)M(rcUc[RSSnUc [5nSnOSnUR5 SR UR 5n[ R "XUR5upQUGH'upx[U5S:XaUSS:XaURUSnO[U5S:a USSS :XdeUSSnURRU5n U (aU nURU(d6US :XdS 5eURRU5n U (aU nSnOSnUR Un U(a+UR"RU 5b[%X*S5S-n['X*U5 UR(R+Xx45 GM* U(aX4$U$![ Ran[U5eSnAff=f) aParse command-line options in args. Store as attributes on object. If 'args' is None or not supplied, uses 'sys.argv[1:]'. If 'object' is None or not supplied, creates a new OptionDummy object, stores option values there, and returns a tuple (args, object). If 'object' is supplied, it is modified in place and 'getopt()' just returns 'args'; in both cases, the returned 'args' is a modified copy of the passed-in 'args' list, which is left untouched. NrTF rIrrz--zboolean option can't have value)sysargv OptionDummyrYjoinrgetoptrerrorrrNrrrRrrrrMgetattrsetattrrr&) rargsobjectcreated_objectroptsmsgr=valrattrs rrbFancyGetopt.getopts <88AB ]F!N"N !XXdoo.  )tHJDHC3x1}Q3ooc!f-3x!|BQ477!"gJJNN3'E>>#&byC"CCy++//4CCC>>#&Dt{{t,8fA.2 F# &    $ $cZ 05: < KG|| )#C( ( )s#F22G GGcJURc [S5eUR$)zReturns the list of (option, value) tuples processed by the previous run of 'getopt()'. Raises RuntimeError if 'getopt()' hasn't been called yet. z!'getopt()' hasn't been called yet)r RuntimeError)rs rget_option_orderFancyGetopt.get_option_orders(    $BC C$$ $rcSnURH7nUSnUSn[U5nUSS:XaUS- nUbUS-nXb:dM5UnM9 US-S-S-nSnX- n S U-n U(aU/n OS /n URHnUSS upEn [X5n USS:XaUSSnUc7U (aU RS X$U S4-5 O\U RS X$4-5 OFSR XE5nU (aU RS X.U S4-5 OU RSU-5 U SSHnU RX-5 M M U $)z|Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object. rrrJrKNrINr\zOption summary:rGz --%-*s %sz --%-*s z{} (-{})z --%-*s)r rN wrap_textr&rP)rheadermax_optr rUrVell opt_width line_width text_width big_indentlinesrWtext opt_namess r generate_helpFancyGetopt.generate_help&s|''F!9D1IEd)CBx3Ag Ag}(aK!Oa' 0 + 9_ HE&'E''F &r DT.DBx3Abz}LL7$q'2J!JKLL!?@ '--d: LL7tAw2O!OPLLi!78ABx Z-. -(0 rcUc[RnURU5HnURUS-5 M g)N )r^stdoutrwrite)rrvfilelines r print_helpFancyGetopt.print_helpts5 <::D&&v.D JJtd{ #/r) rrrrrrr rMrrrr )NN)__name__ __module__ __qualname____firstlineno____doc__rrr#r*r.r4r>rArDrYrbrprr__static_attributes__rrr r sS &P2 40 4  -P1d;z%L\$rr c\[U5nURU5 URX25$r )r rDrb)options negative_optrgrfparsers r fancy_getoptr{s)  !F  - == &&rr\cUc/$[U5U::aU/$UR5nUR[5n[R "SU5nUVs/sH o3(dM UPM nn/nU(a/nSnU(aR[US5nXg-U::aUR US5 US Xg-nOU(aUSSS:XaUS O U(aMRU(a7US:Xa"UR USSU5 USUSUS'USSS:XaUS UR SRU55 U(aMU$s snf)zwrap_text(text : string, width : int) -> [string] Split 'text' into multiple lines of no more than 'width' characters each, and return the list of strings that results. Nz( +|-+)rrJr\r])rN expandtabsr2WS_TRANSresplitr&ra)r~widthchunkschr}cur_linecur_lenrxs rrurusO  |  4yEv ?? D >>( #D XXj$ 'F! (6RRb6F ( E fQi.C}%q *1I!- Q3 6  f !|q !E 23"1Ief-q ay|s"1I  RWWX&'A &D LK)s  D=&D=c,UR[5$)zPConvert a long option name to a valid Python identifier by changing "-" to "_". r1)r=s rtranslate_longoptrs == ''rc$\rSrSrSr/4SjrSrg)r`iz[Dummy class just used as a place to hold command-line option values as instance attributes.c.UHn[XS5 M g)zcCreate a new OptionDummy instance. The attributes listed in 'options' will be initialized to None.N)re)rrr=s rrOptionDummy.__init__sC Dt $rrN)rrrrrrrrrrr`r`s& "%rr`__main__zTra-la-la, supercalifragilisticexpialidocious. How *do* you spell that odd word, anyways? (Someone ask Mary -- she'll know [or she'll say, "How should I know?"].)) (z width: %dr)rr^stringrrberrorsrr longopt_patcompilerSrP neg_alias_rerQ maketransr3r r whitespaceordrrurr`rr~wprintra)_wschars0rrs ; + ZZ+- . zz.// [IJ  c3' X$X$v ' .4->-> ?->'CL# -> ?3l(%% z D  kAo dii $*+, W @sC*