KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21571/root/usr/lib64/python2.4/distutils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21571/root/usr/lib64/python2.4/distutils/fancy_getopt.pyc
mò
‚=5Dc@sAdZdZdkZdkZdkZdkTdkZdkTdZei	deƒZ
ei	deefƒZeiddƒZ
d	fd
„ƒYZd„ZeieideeiƒƒZd
„Zd„Zdfd„ƒYZedjoKdZx>ddddfD]*ZdeGHeieeeƒdƒGHHqWndS(s6distutils.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
s8$Id: fancy_getopt.py 37828 2004-11-10 22:23:15Z loewis $N(t*s[a-zA-Z](?:[a-zA-Z0-9-]*)s^%s$s^(%s)=!(%s)$t-t_tFancyGetoptcBs¤tZdZed„Zd„Zd„Zeed„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
eed„Zd„Zed
„Zeed„ZRS(sÕWrapper 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
    cCsv||_h|_|io|iƒnh|_h|_g|_g|_h|_h|_	h|_
g|_dS(N(toption_tabletselftoption_indext_build_indextaliastnegative_aliast
short_optst	long_optst
short2longt	attr_namet	takes_argtoption_order(RR((t./usr/lib64/python2.4/distutils/fancy_getopt.pyt__init__.s
		
							cCs6|iiƒx"|iD]}||i|d<qWdS(Ni(RRtclearRtoption(RR((RRZs

cCs||_|iƒdS(N(RRR(RR((Rtset_option_table_s	cCsT|ii|ƒotd|‚n-|||f}|ii	|ƒ||i|<dS(Ns'option conflict: already an option '%s'(
RRthas_keytlong_optiontDistutilsGetoptErrortshort_optionthelp_stringRRtappend(RRRRR((Rt
add_optioncs
cCs|ii|ƒS(scReturn true if the option table for this parser has an
        option with long name 'long_option'.N(RRRR(RR((Rt
has_optionmscCsti|tƒS(s’Translate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.N(tstringt	translateRt
longopt_xlate(RR((Rt
get_attr_namerscCs•t|ƒtjpt‚xt|iƒD]f\}}|ii	|ƒpt
d|||f‚n|ii	|ƒpt
d|||f‚q'q'WdS(Ns(invalid %s '%s': option '%s' not defineds0invalid %s '%s': aliased option '%s' not defined(ttypetaliasestDictionaryTypetAssertionErrortitemsRtoptRRRRtwhat(RR"R'R&R((Rt_check_alias_dictys
cCs|i|dƒ||_dS(s'Set the aliases for this option parser.RN(RR(R(RR((Rtset_aliases…scCs|i|dƒ||_dS(sÚSet 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.snegative aliasN(RR(R	(RR	((Rtset_negative_aliasesŠscCs¬g|_g|_|iiƒh|_x}|iD]r}t|ƒdjo|\}}}d}n:t|ƒdjo|\}}}}ntd|f‚t
|ƒtj	pt|ƒdjotd|‚n|djp#t
|ƒtjot|ƒdjptd|‚n||i|<|ii|ƒ|d	d
jo3|o|d}n|dd	!}d|i|<np|ii|ƒ}|dj	oC|i|otd||f‚n||id	<d|i|<nd|i|<|ii|ƒ}|dj	o6|i||i|jotd
||f‚q=nti|ƒptdd|‚n|i|ƒ|i|<|o%|ii|ƒ||i|d<q2q2WdS(sPopulate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        iiisinvalid option tuple: %ris9invalid long option '%s': must be a string of length >= 2is:invalid short option '%s': must a single character or Noneiÿÿÿÿt=t:s>invalid negative alias '%s': aliased option '%s' takes a valuesginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tsinvalid long option name '%s' s'(must be letters, numbers, hyphens onlyN(RRR
RRtrepeatRRtlentlongtshortthelpt
ValueErrorR!t
StringTypeRtNoneRRR	tgettalias_toRt
longopt_retmatchR R
(RR0R1R/R6R-R((Rt_grok_option_table“sR		
	

&3






cCs0|djotid}n|djotƒ}d}nd}|iƒt	i
|iƒ}y"ti|||i
ƒ\}	}Wn!tij
o}t|‚nXxj|	D]b\}}t|ƒdjo&|ddjo|i|d}n6t|ƒdjo|d djpt‚|d}|ii|ƒ}|o
|}n|i|pJ|djp
td‚|ii|ƒ}|o|}d}q¢d}n|i|}
|o3|ii|
ƒdj	ot||
dƒd}nt||
|ƒ|i i!||fƒq­W|o||fSn|SdS(	sParse 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.
        iiiRs--tsboolean option can't have valueN("targsR4tsystargvtobjecttOptionDummytcreated_objectRR9RtjoinR
tgetoptRtoptsterrortmsgtDistutilsArgErrorR&tvalR.RR$RR5RR	R
tattrR-tgetattrtsetattrRR(RR;R>R&RRERGR@R
RCRH((RRBësJ


	

"$+




 cCs(|idjo
td‚n|iSdS(s«Returns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        s!'getopt()' hasn't been called yetN(RRR4tRuntimeError(R((Rtget_option_order+s
cCsñd}x‚|iD]w}|d}
|d}t|
ƒ}	|
ddjo|	d}	n|dj	o|	d}	n|	|jo
|	}qqW|ddd}d}||}
d|}|o
|g}n
d	g}x|iD]}|d
 \}
}}t||
ƒ}|
ddjo|
dd!}
n|djoD|o"|id||
|dfƒqÃ|id||
fƒnKd
|
|f}|o"|id|||dfƒn|id|ƒx#|dD]}	|i||	ƒqÎWqÞW|S(sŒGenerate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        iiiÿÿÿÿR+iiiNt sOption summary:is  --%-*s  %ss
  --%-*s  s%s (-%s)s  --%-*sN(tmax_optRRRR/R0R.tlR4t	opt_widtht
line_widtht
text_widtht
big_indenttheadertlinesR1t	wrap_textttextRt	opt_names(RRTRQR0RRXRSRWRUROR/RNRPRRR1((Rt
generate_help6sL







	

""cCsI|djo
ti}nx(|i|ƒD]}|i|dƒq*WdS(Ns
(	tfileR4R<tstdoutRRYRTtlinetwrite(RRTRZR\((Rt
print_helpŠs


(t__name__t
__module__t__doc__R4RRRRRR R(R)R*R9RBRLRYR^(((RR"s
,		
							X@	TcCs)t|ƒ}|i|ƒ|i||ƒS(N(RtoptionstparserR*tnegative_optRBR;R>(RbRdR>R;Rc((Rtfancy_getopt“s
RMcCs—|djogSnt|ƒ|jo|gSnti|ƒ}ti|tƒ}ti	d|ƒ}td|ƒ}g}x|o
g}d}x{|ost|dƒ}|||jo&|i|dƒ|d=||}q”|o |dddjo|d=nPq”W|o_|djo.|i|dd|!ƒ|d||d<n|dddjo|d=qun|iti|dƒƒq~W|S(s¶wrap_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.
    s( +|-+)iiÿÿÿÿRMR:N(RWR4R.twidthRt
expandtabsRtWS_TRANStretsplittchunkstfilterRUtcur_linetcur_lenRORRA(RWRfRURORmRkRn((RRV›s@

cCsti|tƒS(sXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    N(RRR&R(R&((Rttranslate_longoptØsR?cBstZdZgd„ZRS(s_Dummy class just used as a place to hold command-line option
    values as instance attributes.cCs%x|D]}t||dƒqWdS(skCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N(RbR&RJRR4(RRbR&((RRãs(R_R`RaR(((RR?ßst__main__s¢Tra-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?"].)i
iii(s	width: %ds
(Rat__revision__R<RRittypesRBtdistutils.errorstlongopt_pattcompileR7tneg_alias_ret	maketransRRRet
whitespaceR.RhRVRoR?R_RWtwRA(RhRqRR?R7RWRoR<RiRRtRvRyRRBRVRe((Rt?	s.	ÿr	"	=	

	

Anon7 - 2021