ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/optparse.pyo

oMc@sdZdZdddddddd	d
ddd
ddddgZdZddkZddkZddkZddkZdZyddk	l	Z	Wne
j
odZ	nXe	Zd
efdYZ
de
fdYZdefdYZde
fdYZde
fdYZdefdYZd
fdYZdefd YZdefd!YZd"Zd#Zd$Zheed%fd&6eed'fd(6eed)fd*6eed+fd+6Zd,Zd-Zd.d/fZdfd0YZd1d2Z d1d3Z!ye"Wne#j
od4Z$nXd5Z$dfd6YZ%dfd7YZ&de&fd8YZ'd	e&fd9YZ(d:Z)eZ*dS(;sA powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
s1.5.3tOptiontmake_optiont
SUPPRESS_HELPtSUPPRESS_USAGEtValuestOptionContainertOptionGrouptOptionParsert
HelpFormattertIndentedHelpFormattertTitledHelpFormattert
OptParseErrortOptionErrortOptionConflictErrortOptionValueErrortBadOptionErrors"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
iNcCsd|iit||fS(Ns<%s at 0x%x: %s>(t	__class__t__name__tid(tself((s/usr/lib/python2.6/optparse.pyt_reprOs(tgettextcCs|S(N((tmessage((s/usr/lib/python2.6/optparse.pyR\scBseZdZdZRS(cCs
||_dS(N(tmsg(RR((s/usr/lib/python2.6/optparse.pyt__init__bscCs|iS(N(R(R((s/usr/lib/python2.6/optparse.pyt__str__es(Rt
__module__RR(((s/usr/lib/python2.6/optparse.pyRas	cBs eZdZdZdZRS(s]
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    cCs||_t||_dS(N(Rtstrt	option_id(RRtoption((s/usr/lib/python2.6/optparse.pyRos	cCs*|iod|i|ifS|iSdS(Ns
option %s: %s(RR(R((s/usr/lib/python2.6/optparse.pyRss
(RRt__doc__RR(((s/usr/lib/python2.6/optparse.pyRis	cBseZdZRS(sE
    Raised if conflicting options are added to an OptionParser.
    (RRR(((s/usr/lib/python2.6/optparse.pyR
yscBseZdZRS(sS
    Raised if an invalid option value is encountered on the command
    line.
    (RRR(((s/usr/lib/python2.6/optparse.pyR~scBs eZdZdZdZRS(sB
    Raised if an invalid option is seen on the command line.
    cCs
||_dS(N(topt_str(RR((s/usr/lib/python2.6/optparse.pyRscCstd|iS(Nsno such option: %s(t_R(R((s/usr/lib/python2.6/optparse.pyRs(RRRRR(((s/usr/lib/python2.6/optparse.pyRs	tAmbiguousOptionErrorcBs eZdZdZdZRS(sD
    Raised if an ambiguous option is seen on the command line.
    cCsti||||_dS(N(RRt
possibilities(RRR"((s/usr/lib/python2.6/optparse.pyRscCs#td|idi|ifS(Nsambiguous option: %s (%s?)s, (R RtjoinR"(R((s/usr/lib/python2.6/optparse.pyRs	(RRRRR(((s/usr/lib/python2.6/optparse.pyR!s	cBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZRS(s
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    tnonecCsd|_||_||_|_|djoGyttid}Wntt	fj
o
d}nX|d8}n||_
d|_d|_d|_
||_d|_h|_d|_d|_dS(NtCOLUMNSiPiis%defaults%s %ss%s=%s(tNonetparsertindent_incrementt
help_positiontmax_help_positiontinttostenvirontKeyErrort
ValueErrortwidthtcurrent_indenttlevelt
help_widthtshort_firsttdefault_tagtoption_stringst_short_opt_fmtt
_long_opt_fmt(RR(R*R0R4((s/usr/lib/python2.6/optparse.pyRs$		
								cCs
||_dS(N(R'(RR'((s/usr/lib/python2.6/optparse.pyt
set_parserscCs6|djotd|nd|d|_dS(Ntt s/invalid metavar delimiter for short options: %rs%s(R:R;(R/R7(Rtdelim((s/usr/lib/python2.6/optparse.pytset_short_opt_delimiters
cCs6|djotd|nd|d|_dS(Nt=R;s.invalid metavar delimiter for long options: %rs%s(R>R;(R/R8(RR<((s/usr/lib/python2.6/optparse.pytset_long_opt_delimiters
cCs%|i|i7_|id7_dS(Ni(R1R(R2(R((s/usr/lib/python2.6/optparse.pytindentscCs%|i|i8_|id8_dS(Ni(R1R(R2(R((s/usr/lib/python2.6/optparse.pytdedentscCs
tddS(Nssubclasses must implement(tNotImplementedError(Rtusage((s/usr/lib/python2.6/optparse.pytformat_usagescCs
tddS(Nssubclasses must implement(RB(Rtheading((s/usr/lib/python2.6/optparse.pytformat_headingscCs9|i|i}d|i}ti||d|d|S(s
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        R;tinitial_indenttsubsequent_indent(R0R1ttextwraptfill(Rttextt
text_widthR@((s/usr/lib/python2.6/optparse.pyt_format_texts
	cCs!|o|i|dSdSdS(Ns
R:(RM(Rtdescription((s/usr/lib/python2.6/optparse.pytformat_description
scCs%|od|i|dSdSdS(Ns
R:(RM(Rtepilog((s/usr/lib/python2.6/optparse.pyt
format_epilogscCs~|idjp|io|iS|iii|i}|tjp
|djo
|i}n|ii	|it
|S(N(R'R&R5thelptdefaultstgettdestt
NO_DEFAULTtNO_DEFAULT_VALUEtreplaceR(RRt
default_value((s/usr/lib/python2.6/optparse.pytexpand_defaults
c
	CsDg}|i|}|i|id}t||jo#d|id|f}|i}n d|id||f}d}|i||io|i|}ti||i	}|id|d|df|i
g}|dD]}	|d|id|	fq~n#|ddjo|idndi|S(	Nis%*s%s
R:s	%*s%-*s  iiis
(R6R)R1tlentappendRRRZRItwrapR3textendR#(
RRtresulttoptst	opt_widthtindent_firstt	help_textt
help_linest_[1]tline((s/usr/lib/python2.6/optparse.pyt
format_option!s$




3cCs
|id}xI|iD]>}|i|}||i|<t|t||i}qW|ix]|iD]R}xI|iD]>}|i|}||i|<t|t||i}qWqpW|i|it	|d|i
|_|i|i|_
dS(Nii(R@toption_listtformat_option_stringsR6tmaxR[R1t
option_groupsRAtminR*R)R0R3(RR'tmax_lentopttstringstgroup((s/usr/lib/python2.6/optparse.pytstore_option_stringsDs&


 



$

c
Cs|io|ip
|ii}g}|iD]}||i||fq4~}g}|iD]}||i||fqe~}n|i}|i}|io||}	n||}	di	|	S(s@Return a comma-separated list of option strings & metavariables.s, (
ttakes_valuetmetavarRUtuppert_short_optsR7t
_long_optsR8R4R#(
RRRsRetsoptt
short_optst_[2]tloptt	long_optsR`((s/usr/lib/python2.6/optparse.pyRiVs
*.		

(RRRRWRR9R=R?R@RARDRFRMRORQRZRgRqRi(((s/usr/lib/python2.6/optparse.pyRs")												
	#	cBs5eZdZdddddZdZdZRS(s.Format help with indented section bodies.
    iiicCsti|||||dS(N(RR(RR(R*R0R4((s/usr/lib/python2.6/optparse.pyRmscCstd|S(Ns
Usage: %s
(R (RRC((s/usr/lib/python2.6/optparse.pyRDuscCsd|id|fS(Ns%*s%s:
R:(R1(RRE((s/usr/lib/python2.6/optparse.pyRFxsN(RRRR&RRDRF(((s/usr/lib/python2.6/optparse.pyR	is	cBs5eZdZdddddZdZdZRS(s1Format help with underlined section headers.
    iicCsti|||||dS(N(RR(RR(R*R0R4((s/usr/lib/python2.6/optparse.pyRscCsd|itd|fS(Ns%s  %s
tUsage(RFR (RRC((s/usr/lib/python2.6/optparse.pyRDscCsd|d|it|fS(Ns%s
%s
s=-(R2R[(RRE((s/usr/lib/python2.6/optparse.pyRFsN(RRRR&RRDRF(((s/usr/lib/python2.6/optparse.pyR
|s	cCs|d idjo
d}nT|d idjod}|dpd}n"|d djo
d}nd}|||S(	Nit0xit0bt0iii
(tlower(tvalttypetradix((s/usr/lib/python2.6/optparse.pyt
_parse_nums

cCs
t|tS(N(RR+(R((s/usr/lib/python2.6/optparse.pyt
_parse_intscCs
t|tS(N(Rtlong(R((s/usr/lib/python2.6/optparse.pyt_parse_longstintegerR+slong integerRsfloating-pointtfloattcomplexcCsZt|i\}}y||SWn2tj
o&ttd|||fnXdS(Nsoption %s: invalid %s value: %r(t_builtin_cvtRR/RR (RRntvaluetcvttwhat((s/usr/lib/python2.6/optparse.pyt
check_builtinscCsS||ijo|Sditt|i}ttd|||fdS(Ns, s.option %s: invalid choice: %r (choose from %s)(tchoicesR#tmaptreprRR (RRnRR((s/usr/lib/python2.6/optparse.pytcheck_choices	tNOtDEFAULTcBsNeZdZddddddddd	d
ddgZd-Zd.Zd/Zd0Zd1Zd2Z	he
d6e
d6e
d6e
d6ed6Zd3ZdZdZdZdZdZd Zd!Zd"Zd#Zd$Zd%ZeeeeeeegZd&ZeZd'Zd(Zd)Zd*Z d+Z!d,Z"RS(4sr
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    tactionRRUtdefaulttnargstconstRtcallbackt
callback_argstcallback_kwargsRRRststoretstore_constt
store_truetstore_falseR\tappend_consttcounttversiontstringR+RRRtchoicecOs]g|_g|_|i|}|i||i|x|iD]}||qEWdS(N(RuRvt_check_opt_stringst_set_opt_stringst
_set_attrst
CHECK_METHODS(RR`tattrstchecker((s/usr/lib/python2.6/optparse.pyR0s		


cCs*td|}|ptdn|S(Ns+at least one option string must be supplied(tfilterR&t	TypeError(RR`((s/usr/lib/python2.6/optparse.pyRCscCsx|D]}t|djotd||qt|djoM|ddjo|ddjptd||n|ii|q|dd!djo|ddjptd||n|ii|qWdS(	Nis>invalid option string %r: must be at least two characters longit-isMinvalid short option string %r: must be of the form -x, (x any non-dash char)s--sGinvalid long option string %r: must start with --, followed by non-dash(R[RRuR\Rv(RR`Rn((s/usr/lib/python2.6/optparse.pyRLs&"
%
cCsxn|iD]c}||jot||||||=q
|djot||tq
t||dq
W|o6|i}|itddi||ndS(NRsinvalid keyword arguments: %ss, (tATTRStsetattrRVR&tkeystsortRR#(RRtattr((s/usr/lib/python2.6/optparse.pyRas



cCsN|idjo
d|_n.|i|ijotd|i|ndS(NRsinvalid action: %r(RR&tACTIONSR(R((s/usr/lib/python2.6/optparse.pyt
_check_actionus
cCs9|idjoA|i|ijo*|idj	o
d|_qMd|_q5nddk}t|itijp5t|ido5t	||ii
d|ijo|ii
|_n|idjo
d|_n|i|ijotd|i|n|i|i
jotd|i|ndS(NRRiRRsinvalid option type: %rs$must not supply a type for action %r(RR&RtALWAYS_TYPED_ACTIONSRt__builtin__ttypestTypeTypethasattrtgetattrRtTYPESRt
TYPED_ACTIONS(RR((s/usr/lib/python2.6/optparse.pyt_check_type{s"
"
cCs|idjo||idjotd|qt|ititifjo3tdtt|iidd|qn+|idj	otd|i|ndS(NRs/must supply a list of choices for type 'choice's1choices must be a list of strings ('%s' supplied)t'is#must not supply choices for type %r(	RRR&RRt	TupleTypetListTypeRtsplit(R((s/usr/lib/python2.6/optparse.pyt
_check_choices"1cCs|i|ijp
|idj	}|idjoM|oF|io$|iddidd|_q|idd|_ndS(NiiRR i(Rt
STORE_ACTIONSRR&RURvRXRu(RRr((s/usr/lib/python2.6/optparse.pyt_check_dests
$cCsA|i|ijo*|idj	otd|i|ndS(Ns*'const' must not be supplied for action %r(Rt
CONST_ACTIONSRR&R(R((s/usr/lib/python2.6/optparse.pyt_check_consts#
cCsb|i|ijo!|idjo
d|_q^n+|idj	otd|i|ndS(Nis*'nargs' must not be supplied for action %r(RRRR&R(R((s/usr/lib/python2.6/optparse.pyt_check_nargss
cCs;|idjot|idptd|i|n|idj	o3t|itij	otd|i|n|i	dj	o3t|i	ti
j	otd|i	|q7nq|idj	otd|i|n|idj	otd|n|i	dj	otd|ndS(	NRt__call__scallback not callable: %rs3callback_args, if supplied, must be a tuple: not %rs4callback_kwargs, if supplied, must be a dict: not %rs.callback supplied (%r) for non-callback options.callback_args supplied for non-callback options0callback_kwargs supplied for non-callback option(RRRRRR&RRRRtDictType(R((s/usr/lib/python2.6/optparse.pyt_check_callbacks0cCsdi|i|iS(Nt/(R#RuRv(R((s/usr/lib/python2.6/optparse.pyRscCs
|idj	S(N(RR&(R((s/usr/lib/python2.6/optparse.pyRrscCs%|io|idS|idSdS(Ni(RvRu(R((s/usr/lib/python2.6/optparse.pytget_opt_strings
cCs;|ii|i}|djo|S||||SdS(N(tTYPE_CHECKERRTRR&(RRnRR((s/usr/lib/python2.6/optparse.pytcheck_values
cCsg|dj	oV|idjo|i||Stg}|D]}||i||q<~SndS(Ni(R&RRttuple(RRnRRetv((s/usr/lib/python2.6/optparse.pyt
convert_values
cCs4|i||}|i|i|i||||S(N(Rttake_actionRRU(RRnRtvaluesR'((s/usr/lib/python2.6/optparse.pytprocess
sc	Cs|djot|||n|djot|||inr|djot||tnQ|djot||tn0|djo|i|gi|n|djo |i|gi|in|djo$t|||i|dd	n|d
jo@|ipd}|iph}|i||||||n[|djo|i	|i
n6|djo|i|i
ntd
|i
d	S(NRRRRR\RRiiRRRRsunknown action %r((RRtTruetFalsetensure_valueR\RRRt
print_helptexitt
print_versiontRuntimeErrorR(	RRRURnRRR'targstkwargs((s/usr/lib/python2.6/optparse.pyRs4





 
$
 



(
sstoresstore_consts
store_truesstore_falsesappendsappend_constscountscallbackshelpsversion(sstoresstore_consts
store_truesstore_falsesappendsappend_constscount(sstoresappendscallback(sstoresappend(sstore_constsappend_const(sstringsintslongsfloatscomplexschoiceN(#RRRRRRRRRRRRRR&RRRRRRRRRRRRRRt__repr__RrRRRRR(((s/usr/lib/python2.6/optparse.pyRs	

								
													tSUPPRESStHELPtUSAGEcCst|titifS(N(t
isinstanceRt
StringTypetUnicodeType(tx((s/usr/lib/python2.6/optparse.pytisbasestring=scCs
t|tS(N(Rt
basestring(R((s/usr/lib/python2.6/optparse.pyR@scBsheZd
dZdZeZdZdZdZ	dZ
ddZddZd	Z
RS(cCs<|o1x.|iD]\}}t|||qWndS(N(titemsR(RRSRR((s/usr/lib/python2.6/optparse.pyREs
cCs
t|iS(N(Rt__dict__(R((s/usr/lib/python2.6/optparse.pyRJscCsPt|tot|i|iSt|tiot|i|SdSdS(Ni(RRtcmpRRR(Rtother((s/usr/lib/python2.6/optparse.pyt__cmp__Os
cCsWxPt|D]B}||jo/||}|dj	ot|||qOq
q
WdS(s
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        N(tdirR&R(RtdictRtdval((s/usr/lib/python2.6/optparse.pyt_update_carefulWs



cCs|ii|dS(s
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        N(Rtupdate(RR((s/usr/lib/python2.6/optparse.pyt
_update_loosedscCsM|djo|i|n,|djo|i|ntd|dS(Ntcarefultloosesinvalid update mode: %r(RRR/(RRtmode((s/usr/lib/python2.6/optparse.pyt_updatels


RcCs1t|ti|}|it||dS(N(t
__import__tsystmodulesRtvars(RtmodnameRtmod((s/usr/lib/python2.6/optparse.pytread_modulets

cCs'h}t|||i||dS(N(texecfileR(RtfilenameRR((s/usr/lib/python2.6/optparse.pyt	read_fileys
cCsHt||pt||djot|||nt||S(N(RRR&R(RRR((s/usr/lib/python2.6/optparse.pyR~s'N(RRR&RRRRRRRRRRR(((s/usr/lib/python2.6/optparse.pyRCs			
		cBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZRS(s
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appears in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    cCs1|i||_|i||i|dS(N(t_create_option_listtoption_classtset_conflict_handlertset_description(RRtconflict_handlerRN((s/usr/lib/python2.6/optparse.pyRs
	
cCsh|_h|_h|_dS(N(t
_short_optt	_long_optRS(R((s/usr/lib/python2.6/optparse.pyt_create_option_mappingss		cCs(|i|_|i|_|i|_dS(N(RRRS(RR'((s/usr/lib/python2.6/optparse.pyt_share_option_mappingsscCs+|djotd|n||_dS(Nterrortresolves$invalid conflict_resolution value %r(serrorR(R/R(Rthandler((s/usr/lib/python2.6/optparse.pyRs
cCs
||_dS(N(RN(RRN((s/usr/lib/python2.6/optparse.pyRscCs|iS(N(RN(R((s/usr/lib/python2.6/optparse.pytget_descriptionscCs|`|`|`dS(ssee OptionParser.destroy().N(RRRS(R((s/usr/lib/python2.6/optparse.pytdestroyscCsg}x?|iD]4}||ijo|i||i|fqqWx?|iD]4}||ijo|i||i|fqRqRW|o|i}|djo?tddig}|D]}||dq~|q|djox|D]\}}|ido|ii	||i|=n|ii	||i|=|ip|ip|i
ii	|qqWqndS(NRs conflicting option string(s): %ss, iRs--(RuRR\RvRRR
R#t
startswithtremovet	containerRh(RRt
conflict_optsRnR
Retcotc_option((s/usr/lib/python2.6/optparse.pyt_check_conflicts4
"
"	
,


cOsQt|dtijo|i||}nTt|djo7|o/|d}t|tptd|qn
td|i||i	i
|||_x|iD]}||i
|<qWx|iD]}||i|<qW|idj	oR|itj	o|i|i|i<qM|i|ijod|i|i<qMn|S(sOadd_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        iisnot an Option instance: %rsinvalid argumentsN(RRtStringTypesRR[RRRRRhR\RRuRRvRRUR&RRVRS(RRRRRn((s/usr/lib/python2.6/optparse.pyt
add_options,
	
	

cCs"x|D]}|i|qWdS(N(R(RRhR((s/usr/lib/python2.6/optparse.pytadd_options
scCs#|ii|p|ii|S(N(RRTR(RR((s/usr/lib/python2.6/optparse.pyt
get_optionscCs||ijp
||ijS(N(RR(RR((s/usr/lib/python2.6/optparse.pyt
has_optionscCs|ii|}|djo|ii|}n|djotd|nx|iD]}|i|=q`Wx|iD]}|i|=q~W|iii	|dS(Nsno such option %r(
RRTR&RR/RuRvRRhR(RRRRn((s/usr/lib/python2.6/optparse.pyt
remove_options



cCs`|ipdSg}x;|iD]0}|itj	o|i|i|qqWdi|S(NR:(RhRRRR\RgR#(Rt	formatterR_R((s/usr/lib/python2.6/optparse.pytformat_option_help+s

cCs|i|iS(N(ROR(RR((s/usr/lib/python2.6/optparse.pyRO4scCs[g}|io|i|i|n|io|i|i|ndi|S(Ns
(RNR\RORhRR#(RRR_((s/usr/lib/python2.6/optparse.pytformat_help7s

(RRRRR	R
RRRRRRRRRRRROR(((s/usr/lib/python2.6/optparse.pyRs"																		cBs8eZddZdZdZdZdZRS(cCs2||_ti||i|i|||_dS(N(R'RRRRttitle(RR'R RN((s/usr/lib/python2.6/optparse.pyRBs	cCsg|_|i|idS(N(RhR
R'(R((s/usr/lib/python2.6/optparse.pyRHs	cCs
||_dS(N(R (RR ((s/usr/lib/python2.6/optparse.pyt	set_titleLscCsti||`dS(ssee OptionParser.destroy().N(RRRh(R((s/usr/lib/python2.6/optparse.pyROs
cCs@|i|i}|i|ti||7}|i|S(N(RFR R@RRRA(RRR_((s/usr/lib/python2.6/optparse.pyRVs


N(RRR&RRR!RR(((s/usr/lib/python2.6/optparse.pyR@s
			cBseZdZgZd)d)ed)dd)d)ed)d)d
ZdZdZ	dZ
dZedZdZ
d	Zd
ZdZdZd
ZdZdZdZdZdZdZd)d)dZdZdZdZdZdZdZdZ dZ!dd)dZ"dZ#d Z$d)d!Z%d"Z&d)d#Z'd)d$Z(d%Z)d)d&Z*d'Z+d)d(Z,RS(*s
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    RcCsti|||||i||	|_||_t|_t|_|djo
t	}n||_
|i
i||
|_|i
|d||idS(Ntadd_help(RRt	set_usagetprogRRtallow_interspersed_argstprocess_default_valuesR&R	RR9RPt_populate_option_listt_init_parsing_state(RRCRhRRRRNRtadd_help_optionR$RP((s/usr/lib/python2.6/optparse.pyRs
				

		cCsAti|x|iD]}|iqW|`|`|`dS(s
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        N(RRRkRhR(RRp((s/usr/lib/python2.6/optparse.pyRs

cCs g|_g|_|idS(N(RhRkR	(R((s/usr/lib/python2.6/optparse.pyRs		cCs&|idddddtddS(Ns-hs--helpRRRsshow this help message and exit(RR (R((s/usr/lib/python2.6/optparse.pyt_add_help_optionscCs#|iddddtddS(Ns	--versionRRRRs&show program's version number and exit(RR (R((s/usr/lib/python2.6/optparse.pyt_add_version_optionscCsg|io|i|in|o|i|n|io|in|o|indS(N(tstandard_option_listRRR+R*(RRhR"((s/usr/lib/python2.6/optparse.pyR's

cCsd|_d|_d|_dS(N(R&trargstlargsR(R((s/usr/lib/python2.6/optparse.pyR(s		cCsn|djotd|_nK|tjo
d|_n1|iido|d|_n
||_dS(Ns%prog [options]susage: i(R&R RCRRR(RRC((s/usr/lib/python2.6/optparse.pyR#s


cCs
t|_dS(sSet parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args.N(RR%(R((s/usr/lib/python2.6/optparse.pytenable_interspersed_argsscCs
t|_dS(sSet parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        N(RR%(R((s/usr/lib/python2.6/optparse.pytdisable_interspersed_args
scCs
||_dS(N(R&(RR((s/usr/lib/python2.6/optparse.pytset_process_default_valuesscCs||i|<dS(N(RS(RRUR((s/usr/lib/python2.6/optparse.pytset_defaultscKs|ii|dS(N(RSR(RR((s/usr/lib/python2.6/optparse.pytset_defaultsscCs2|i}x!|iD]}|i|iqW|S(N(RhRkR^(RtoptionsRp((s/usr/lib/python2.6/optparse.pyt_get_all_optionss


cCs|ipt|iS|ii}x\|iD]N}|i|i}t|o)|i}|i	||||i<q4q4Wt|S(N(
R&RRStcopyR5RTRURRR(RRSRRR((s/usr/lib/python2.6/optparse.pytget_default_values!s


!cOst|dtijot|||}nqt|djoT|oL|d}t|tptd|n|i|j	o
tdqn
td|i	i
||S(Niisnot an OptionGroup instance: %rs"invalid OptionGroup (wrong parser)sinvalid arguments(RRRRR[RRR'R/RkR\(RRRRp((s/usr/lib/python2.6/optparse.pytadd_option_group2s
	cCsH|ii|p|ii|}|o|i|j	o|iSdS(N(RRTRRR&(RRR((s/usr/lib/python2.6/optparse.pytget_option_groupBs
cCs"|djotidS|SdS(Ni(R&Rtargv(RR((s/usr/lib/python2.6/optparse.pyt	_get_argsLs
cCs|i|}|djo|i}n||_g|_}||_y|i|||}Wn.ttfj
o}|i	t
|nX||}|i||S(sS
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is an Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        N(R;R&R7R-R.Rt
_process_argsRRRRtcheck_values(RRRR-R.tstopterr((s/usr/lib/python2.6/optparse.pyt
parse_argsRs
	
	
cCs
||fS(s
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        ((RRR((s/usr/lib/python2.6/optparse.pyR=yscCsx|o|d}|djo|d=dS|dd!djo|i||q|d djo't|djo|i||q|io|i||d=qdSqWdS(s_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        is--NiiR(t_process_long_optR[t_process_short_optsR%R\(RR.R-Rtarg((s/usr/lib/python2.6/optparse.pyR<s


$

cCst||iS(s_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbrevation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        (t
_match_abbrevR(RRn((s/usr/lib/python2.6/optparse.pyt_match_long_optsc
Csk|id}d|jo2|idd\}}|id|t}n
|}t}|i|}|i|}|io|i}t	||joI|djo|i
td|q%|i
td||fqQ|djo|id}	qQt|d|!}	|d|5n)|o|i
td|nd}	|i||	||dS(NiR>is%s option requires an arguments%s option requires %d argumentss%s option does not take a value(tpopRtinsertRRRERRrRR[RR RR&R(
RR-RRCRntnext_argthad_explicit_valueRRR((s/usr/lib/python2.6/optparse.pyRAs0



	

c	Cs}|id}t}d}x[|dD]O}d|}|ii|}|d7}|pt|n|io|t|jo|id||t}n|i	}	t||	joI|	djo|i
td|qI|i
td||	fqS|	djo|id}
qSt|d|	!}
|d|	5nd}
|i||
|||oPq&q&WdS(NiiRs%s option requires an arguments%s option requires %d arguments(RFRRRTRRrR[RGRRRR RR&R(RR-RRCR>titchRnRRR((s/usr/lib/python2.6/optparse.pyRBs8



	

cCs3|idjotiitidS|iSdS(Ni(R$R&R,tpathtbasenameRR:(R((s/usr/lib/python2.6/optparse.pyt
get_prog_namescCs|id|iS(Ns%prog(RXRN(Rts((s/usr/lib/python2.6/optparse.pytexpand_prog_namescCs|i|iS(N(RPRN(R((s/usr/lib/python2.6/optparse.pyRsicCs,|otii|nti|dS(N(RtstderrtwriteR(RtstatusR((s/usr/lib/python2.6/optparse.pyRscCs4|iti|idd|i|fdS(serror(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        is%s: error: %s
N(tprint_usageRRQRRN(RR((s/usr/lib/python2.6/optparse.pyR"scCs/|io|ii|i|iSdSdS(NR:(RCRRDRP(R((s/usr/lib/python2.6/optparse.pyt	get_usage,s
	cCs"|io||iIJndS(saprint_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        N(RCRU(Rtfile((s/usr/lib/python2.6/optparse.pyRT3s	
cCs#|io|i|iSdSdS(NR:(RRP(R((s/usr/lib/python2.6/optparse.pytget_version?s
cCs"|io||iIJndS(sEprint_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        N(RRW(RRV((s/usr/lib/python2.6/optparse.pyREs
cCs|djo
|i}n|i|g}|i|itd|i|io*|iti	|||idnx4|i
D])}|i|i||idqW|idi
|d S(NtOptionss
R:i(R&RRqR\RFR R@RhRRRkRRAR#(RRR_Rp((s/usr/lib/python2.6/optparse.pyRPs






cCs|i|iS(N(RQRP(RR((s/usr/lib/python2.6/optparse.pyRQascCs|djo
|i}ng}|io|i|idn|io|i|i|dn|i|i||i|i|di	|S(Ns
R:(
R&RRCR\RURNRORRQR#(RRR_((s/usr/lib/python2.6/optparse.pyRds



cCs-t|dd}|pti}n|S(Ntencoding(RR&Rtgetdefaultencoding(RRVRY((s/usr/lib/python2.6/optparse.pyt
_get_encodingqscCsL|djo
ti}n|i|}|i|ii|ddS(sprint_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        RXN(R&RtstdoutR[RRRtencode(RRVRY((s/usr/lib/python2.6/optparse.pyRws

N(-RRRR,R&RRRRRR*R+R'R(R#R/R0R1R2R3R5R7R8R9R;R@R=R<RERARBRNRPRRRRURTRWRRRQRR[R(((s/usr/lib/python2.6/optparse.pyR^sb?				
												
	'	
	3			%	*				
			
	cCs||jo|Sg}|iD]!}|i|o||q#q#~}t|djo	|dS|pt|n|it||dS(s_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    iiN(RRR[RRR!(ROtwordmapRetwordR"((s/usr/lib/python2.6/optparse.pyRDs
$	
(+Rt__version__t__all__t
__copyright__RR,RRIRRtImportErrorR t	ExceptionRRR
RRR!RR	R
RRRRRRRRRVRRRRt	NameErrorRRRRRRDR(((s/usr/lib/python2.6/optparse.pyt<module>s~	 	


	
				{

	A)	

ACC SHELL 2018