%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/argparse.pyc


Mac@sdZdZdddddddd	d
ddd
ddddgZddlZddlZddlZddl	Z
ddlZddl
ZddlmZdZdZdZdZdZdZdZdZdefdYZdZdefd YZdefd!YZd	efd"YZdefd#YZd$Z de!fd%YZ"de!fd&YZ#defd'YZ$d(e$fd)YZ%d*e$fd+YZ&d,e&fd-YZ'd.e&fd/YZ(d0e$fd1YZ)d2e$fd3YZ*d4e$fd5YZ+d6e$fd7YZ,d8e$fd9YZ-d:e$fd;YZ.defd<YZ/d
efd=YZ0d>efd?YZ1d@e1fdAYZ2dBe2fdCYZ3dee1fdDYZ4dS(Es
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.)
s1.1tArgumentParsert
ArgumentErrortArgumentTypeErrortFileTypet
HelpFormattertArgumentDefaultsHelpFormattertRawDescriptionHelpFormattertRawTextHelpFormattert	NamespacetActiontONE_OR_MOREtOPTIONALtPARSERt	REMAINDERtSUPPRESStZERO_OR_MOREiN(tgettextcCst|dpt|dS(Nt__call__t	__bases__(thasattr(tobj((s$/usr/local/lib/python2.7/argparse.pyt	_callable_ss==SUPPRESS==t?t*t+sA...s...t_unrecognized_argst_AttributeHoldercBs)eZdZdZdZdZRS(sAbstract 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__.
    cCst|j}g}x'|jD]}|jt|q"Wx1|jD]#\}}|jd||fqLWd|dj|fS(Ns%s=%rs%s(%s)s, (ttypet__name__t	_get_argstappendtreprt_get_kwargstjoin(tselft	type_nametarg_stringstargtnametvalue((s$/usr/local/lib/python2.7/argparse.pyt__repr__yscCst|jjS(N(tsortedt__dict__titems(R"((s$/usr/local/lib/python2.7/argparse.pyR scCsgS(N((R"((s$/usr/local/lib/python2.7/argparse.pyRs(Rt
__module__t__doc__R(R R(((s$/usr/local/lib/python2.7/argparse.pyRps			cCs8t||ddkr+t|||nt||S(N(tgetattrtNonetsetattr(t	namespaceR&R'((s$/usr/local/lib/python2.7/argparse.pyt
_ensure_valuescBseZdZddddZdZdZdefdYZdZ	d	Z
d
ZdZddZ
d
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZRS(sFormatter 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.
    iicCs|dkrPyttjd}Wnttfk
rBd}nX|d8}n||_||_||_t	|t
|d|d|_||_d|_d|_
d|_|j|d|_|j|_tjd|_tjd|_dS(NtCOLUMNSiPiiis\s+s\n\n\n+(R/tintt_ostenvirontKeyErrort
ValueErrort_progt_indent_incrementt_max_help_positiontmintmaxt_widtht_current_indentt_levelt_action_max_lengtht_Sectiont
_root_sectiont_current_sectiont_retcompilet_whitespace_matchert_long_break_matcher(R"tprogtindent_incrementtmax_help_positiontwidth((s$/usr/local/lib/python2.7/argparse.pyt__init__s&

							cCs%|j|j7_|jd7_dS(Ni(R?R:R@(R"((s$/usr/local/lib/python2.7/argparse.pyt_indentscCs@|j|j8_|jdks-td|jd8_dS(NisIndent decreased below 0.i(R?R:tAssertionErrorR@(R"((s$/usr/local/lib/python2.7/argparse.pyt_dedentsRBcBseZddZdZRS(cCs(||_||_||_g|_dS(N(t	formattertparenttheadingR+(R"RQRRRS((s$/usr/local/lib/python2.7/argparse.pyRMs			cCs|jdk	r|jjn|jj}x!|jD]\}}||q5W|g|jD]\}}||^q\}|jdk	r|jjn|sdS|jtk	r|jdk	r|jj	}d|d|jf}nd}|d||dgS(Nts%*s%s:
s
(
RRR/RQRNt_join_partsR+RPRSRR?(R"R!tfunctargst	item_helptcurrent_indentRS((s$/usr/local/lib/python2.7/argparse.pytformat_helps.N(RR,R/RMRZ(((s$/usr/local/lib/python2.7/argparse.pyRBscCs|jjj||fdS(N(RDR+R(R"RVRW((s$/usr/local/lib/python2.7/argparse.pyt	_add_itemscCsB|j|j||j|}|j|jg||_dS(N(RNRBRDR[RZ(R"RStsection((s$/usr/local/lib/python2.7/argparse.pyt
start_sections
cCs|jj|_|jdS(N(RDRRRP(R"((s$/usr/local/lib/python2.7/argparse.pytend_sectionscCs5|tk	r1|dk	r1|j|j|gndS(N(RR/R[t_format_text(R"ttext((s$/usr/local/lib/python2.7/argparse.pytadd_textscCs8|tk	r4||||f}|j|j|ndS(N(RR[t
_format_usage(R"tusagetactionstgroupstprefixRW((s$/usr/local/lib/python2.7/argparse.pyt	add_usagescCs|jtk	r|j}||g}x*|j|D]}|j||q7Wtg|D]}t|^q^}||j}t|j||_|j	|j
|gndS(N(thelpRt_format_action_invocationt_iter_indented_subactionsRR=tlenR?RAR[t_format_action(R"tactiontget_invocationtinvocationst	subactiontstinvocation_lengtht
action_length((s$/usr/local/lib/python2.7/argparse.pytadd_arguments	%
	cCs"x|D]}|j|qWdS(N(Rt(R"RdRm((s$/usr/local/lib/python2.7/argparse.pyt
add_argumentss
cCsD|jj}|r@|jjd|}|jdd}n|S(Ns

s
(RCRZRHtsubtstrip(R"Rh((s$/usr/local/lib/python2.7/argparse.pyRZs
cCs2djg|D]}|r
|tk	r
|^q
S(NRT(R!R(R"tpart_stringstpart((s$/usr/local/lib/python2.7/argparse.pyRUs	
cs|dkrtd}n|dk	r@|td|j}n|dkrl|rldtd|j}n|dkr
dtd|j}g}g}x4|D],}|jr|j|q|j|qW|j}	|	|||}
djg||
gD]}|r|^q}|j|j	t
|t
|kr
d}|	||}
|	||}tj||
}tj||}dj||
kst
dj||kst
dfd}t
|t
|dkr{dt
|t
|d}|rM||g|||}|j|||q|ro||g|||}q|g}n}dt
|}||}|||}t
|dkrg}|j||||j|||n|g|}d	j|}q
nd
||fS(Nsusage: RIs%(prog)st s%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+csg}g}|dk	r+t|d}nt|d}x|D]z}|dt|kr|r|j|dj|g}t|d}n|j||t|d7}qBW|r|j|dj|n|dk	r
|dt||d<n|S(NiRzi(R/RkRR!(tpartstindentRftlinestlinetline_lenRy(t
text_width(s$/usr/local/lib/python2.7/argparse.pyt	get_linesTs"
 
g?is
s%s%s

(R/t_tdictR9toption_stringsRt_format_actions_usageR!R>R?RkREtfindallROtextend(R"RcRdReRfRIt	optionalstpositionalsRmtformattaction_usageRqtpart_regexpt	opt_usaget	pos_usaget	opt_partst	pos_partsRR|R}R{((Rs$/usr/local/lib/python2.7/argparse.pyRb$sZ
		. 

cCst}i}x&|D]}y|j|jd}Wntk
rLqqX|t|j}|||!|jkrx|jD]}|j|qW|js||kr||cd7<n
d||<d||<n3||kr||cd7<n
d||<d||<x(t|d|D]}	d	||	<qWqqWg}
xt|D]t\}	}|j	t
kr|
jd|j
|	d	kr|j|	q|j
|	dd	kr|j|	dqqK|js5|j||j}||kr%|ddkr%|d
dkr%|dd
!}q%n|
j|qK|jd}|jdkr^d|}n1|jj}
|j||
}d||f}|jr||krd
|}n|
j|qKWx.t|dtD]}	||	g|
|	|	+qWdjg|
D]}|dk	r|^q}d}d}tjd|d|}tjd|d|}tjd||fd|}tjdd|}|j}|S(Nis [t[t]s (t(t)it|is%ss%s %ss[%s]treverseRzs[\[(]s[\])]s(%s) s\1s (%s)s%s *%sRTs\(([^|]*)\)(tsettindext_group_actionsR8Rktaddtrequiredtranget	enumerateRhRRR/tgettpopRt_format_argstdesttnargstupperR)tTrueR!RERvRw(R"RdRet
group_actionstinsertstgrouptstarttendRmtiR{Ryt
option_stringtdefaulttargs_stringtitemR`topentclose((s$/usr/local/lib/python2.7/argparse.pyRsp	

	




	 


.cCsbd|kr%|td|j}nt|j|jd}d|j}|j|||dS(Ns%(prog)RIiRzs

(RR9R=R>R?t
_fill_text(R"R`RR|((s$/usr/local/lib/python2.7/argparse.pyR_s

c
Cst|jd|j}t|j|d}||jd}|j|}|jsw|jd|f}d|}n\t||kr|jd||f}d|}d}n"|jd|f}d|}|}|g}|jrV|j	|}	|j
|	|}
|jd|d|
dfxN|
dD] }|jd|d|fq/Wn|jdsu|jdnx-|j
|D]}|j|j|qW|j|S(	NiiRTs%*s%s
s	%*s%-*s  iis
(R<RAR;R=R>R?RiRhRkt_expand_helpt_split_linesRtendswithRjRlRU(
R"Rmt
help_positiont
help_widthtaction_widtht
action_headerttuptindent_firstR{t	help_textt
help_linesR~Rp((s$/usr/local/lib/python2.7/argparse.pyRls6
	

	
		!cCs|js+|j||jd\}|Sg}|jdkrS|j|jnL|jj}|j||}x(|jD]}|jd||fq~Wdj|SdS(Niis%s %ss, (	Rt_metavar_formatterRRRRRRR!(R"RmtmetavarR{RRR((s$/usr/local/lib/python2.7/argparse.pyRis	cs{|jdk	r|jnM|jdk	rbg|jD]}t|^q4}ddj|n|fd}|S(Ns{%s}t,cs"ttrSf|SdS(N(t
isinstancettuple(t
tuple_size(tresult(s$/usr/local/lib/python2.7/argparse.pyR:s(RR/tchoiceststrR!(R"Rmtdefault_metavartchoicetchoice_strsR((Rs$/usr/local/lib/python2.7/argparse.pyR1s"cCs|j||}|jdkr4d|d}n|jtkrVd|d}n|jtkrxd|d}n|jtkrd|d}nx|jtkrd}n`|jtkrd|d}n>gt|jD]}d^q}d	j	|||j}|S(
Ns%sis[%s]s
[%s [%s ...]]is%s [%s ...]s...s%s ...Rz(
RRR/RRR
R
RRR!(R"RmRtget_metavarRRtformats((s$/usr/local/lib/python2.7/argparse.pyRAs 	"cCstt|d|j}x.t|D] }||tkr(||=q(q(Wx;t|D]-}t||drY||j||<qYqYW|jddk	rdj	g|dD]}t
|^q}||d<n|j||S(NRIRRs, (RtvarsR9tlistRRRRR/R!Rt_get_help_string(R"RmtparamsR&tctchoices_str((s$/usr/local/lib/python2.7/argparse.pyRTs,
ccsRy
|j}Wntk
r n.X|jx|D]}|Vq5W|jdS(N(t_get_subactionstAttributeErrorRNRP(R"Rmtget_subactionsRp((s$/usr/local/lib/python2.7/argparse.pyRjas


	cCs+|jjd|j}tj||S(NRz(RGRvRwt	_textwraptwrap(R"R`RL((s$/usr/local/lib/python2.7/argparse.pyRlscCs7|jjd|j}tj||d|d|S(NRztinitial_indenttsubsequent_indent(RGRvRwRtfill(R"R`RLR|((s$/usr/local/lib/python2.7/argparse.pyRpscCs|jS(N(Rh(R"Rm((s$/usr/local/lib/python2.7/argparse.pyRusN(RR,R-R/RMRNRPtobjectRBR[R]R^RaRgRtRuRZRURbRR_RlRiRRRRjRRR(((s$/usr/local/lib/python2.7/argparse.pyRs8		!									`	`		/				
			cBseZdZdZRS(sHelp 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.
    cCs-djg|jtD]}||^qS(NRT(R!t
splitlinesR(R"R`RLR|R~((s$/usr/local/lib/python2.7/argparse.pyRs(RR,R-R(((s$/usr/local/lib/python2.7/argparse.pyRyscBseZdZdZRS(sHelp 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.
    cCs
|jS(N(R(R"R`RL((s$/usr/local/lib/python2.7/argparse.pyRs(RR,R-R(((s$/usr/local/lib/python2.7/argparse.pyRscBseZdZdZRS(sHelp 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.
    cCsb|j}d|jkr^|jtk	r^ttg}|jsK|j|kr[|d7}q[q^n|S(Ns
%(default)s (default: %(default)s)(RhRRRRRR(R"RmRhtdefaulting_nargs((s$/usr/local/lib/python2.7/argparse.pyRs	(RR,R-R(((s$/usr/local/lib/python2.7/argparse.pyRscCsi|dkrdS|jr)dj|jS|jdtfkrE|jS|jdtfkra|jSdSdS(Nt/(R/RR!RRR(targument((s$/usr/local/lib/python2.7/argparse.pyt_get_action_names	cBs eZdZdZdZRS(sAn 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.
    cCst||_||_dS(N(Rt
argument_nametmessage(R"RR((s$/usr/local/lib/python2.7/argparse.pyRMscCs;|jdkrd}nd}|td|jd|jS(Ns%(message)ss'argument %(argument_name)s: %(message)sRR(RR/RR(R"R((s$/usr/local/lib/python2.7/argparse.pyt__str__s
	(RR,R-RMR(((s$/usr/local/lib/python2.7/argparse.pyRs	cBseZdZRS(s@An error from trying to convert a command line string to a type.(RR,R-(((s$/usr/local/lib/python2.7/argparse.pyRsc	BsDeZdZdddddedddZdZddZRS(s\	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.
    cCs^||_||_||_||_||_||_||_||_|	|_|
|_	dS(N(
RRRtconstRRRRRhR(R"RRRRRRRRRhR((s$/usr/local/lib/python2.7/argparse.pyRMs									c	CsGddddddddd	g	}g|D]}|t||f^q(S(
NRRRRRRRRhR(R.(R"tnamesR&((s$/usr/local/lib/python2.7/argparse.pyR s	cCsttddS(Ns.__call__() not defined(tNotImplementedErrorR(R"tparserR1tvaluesR((s$/usr/local/lib/python2.7/argparse.pyR%sN(RR,R-R/tFalseRMR R(((s$/usr/local/lib/python2.7/argparse.pyR	s1	t_StoreActionc	Bs5eZdddddedddZddZRS(cCs|dkrtdn|dk	rF|tkrFtdtntt|jd|d|d|d|d|d	|d
|d|d|	d
|

dS(Nisnargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriates nargs must be %r to supply constRRRRRRRRRhR(R8R/RtsuperRRM(R"RRRRRRRRRhR((s$/usr/local/lib/python2.7/argparse.pyRM+scCst||j|dS(N(R0R(R"RR1RR((s$/usr/local/lib/python2.7/argparse.pyRHsN(RR,R/RRMR(((s$/usr/local/lib/python2.7/argparse.pyR)st_StoreConstActioncBs)eZdedddZddZRS(cCsAtt|jd|d|ddd|d|d|d|dS(	NRRRiRRRRh(RRRM(R"RRRRRRhR((s$/usr/local/lib/python2.7/argparse.pyRMNscCst||j|jdS(N(R0RR(R"RR1RR((s$/usr/local/lib/python2.7/argparse.pyR_sN(RR,R/RRMR(((s$/usr/local/lib/python2.7/argparse.pyRLs

t_StoreTrueActioncBseZeeddZRS(c
Cs;tt|jd|d|dtd|d|d|dS(NRRRRRRh(RRRMR(R"RRRRRh((s$/usr/local/lib/python2.7/argparse.pyRMesN(RR,RR/RM(((s$/usr/local/lib/python2.7/argparse.pyRcst_StoreFalseActioncBseZeeddZRS(c
Cs;tt|jd|d|dtd|d|d|dS(NRRRRRRh(RRRMR(R"RRRRRh((s$/usr/local/lib/python2.7/argparse.pyRMvsN(RR,RRR/RM(((s$/usr/local/lib/python2.7/argparse.pyRtst
_AppendActionc	Bs5eZdddddedddZddZRS(cCs|dkrtdn|dk	rF|tkrFtdtntt|jd|d|d|d|d|d	|d
|d|d|	d
|

dS(Nisnargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriates nargs must be %r to supply constRRRRRRRRRhR(R8R/RRRRM(R"RRRRRRRRRhR((s$/usr/local/lib/python2.7/argparse.pyRMscCsBtjt||jg}|j|t||j|dS(N(t_copytcopyR2RRR0(R"RR1RRR+((s$/usr/local/lib/python2.7/argparse.pyRs
N(RR,R/RRMR(((s$/usr/local/lib/python2.7/argparse.pyRst_AppendConstActioncBs)eZdedddZddZRS(cCsGtt|jd|d|ddd|d|d|d|d	|dS(
NRRRiRRRRhR(RRRM(R"RRRRRRhR((s$/usr/local/lib/python2.7/argparse.pyRMscCsEtjt||jg}|j|jt||j|dS(N(RRR2RRRR0(R"RR1RRR+((s$/usr/local/lib/python2.7/argparse.pyRsN(RR,R/RRMR(((s$/usr/local/lib/python2.7/argparse.pyRs
t_CountActioncBs&eZdeddZddZRS(c
Cs;tt|jd|d|ddd|d|d|dS(NRRRiRRRh(RRRM(R"RRRRRh((s$/usr/local/lib/python2.7/argparse.pyRMscCs0t||jdd}t||j|dS(Nii(R2RR0(R"RR1RRt	new_count((s$/usr/local/lib/python2.7/argparse.pyRsN(RR,R/RRMR(((s$/usr/local/lib/python2.7/argparse.pyRs	t_HelpActioncBs&eZeeddZddZRS(cCs5tt|jd|d|d|ddd|dS(NRRRRiRh(RRRM(R"RRRRh((s$/usr/local/lib/python2.7/argparse.pyRMscCs|j|jdS(N(t
print_helptexit(R"RR1RR((s$/usr/local/lib/python2.7/argparse.pyRs
N(RR,RR/RMR(((s$/usr/local/lib/python2.7/argparse.pyRst_VersionActioncBs)eZdeeddZddZRS(s&show program's version number and exitcCs>tt|jd|d|d|ddd|||_dS(NRRRRiRh(RRRMtversion(R"RRRRRh((s$/usr/local/lib/python2.7/argparse.pyRMscCsT|j}|dkr!|j}n|j}|j||jd|jdS(NR(RR/t_get_formatterRaRRZ(R"RR1RRRRQ((s$/usr/local/lib/python2.7/argparse.pyRs	
N(RR,R/RRMR(((s$/usr/local/lib/python2.7/argparse.pyRs
	t_SubParsersActioncBsNeZdefdYZedddZdZdZddZ	RS(t_ChoicesPseudoActioncBseZdZRS(cCs2ttj|}|jdgd|d|dS(NRRRh(RRRRM(R"R&Rhtsup((s$/usr/local/lib/python2.7/argparse.pyRM	s(RR,RM(((s$/usr/local/lib/python2.7/argparse.pyRsc
Csh||_||_tj|_g|_tt|jd|d|dt	d|jd|d|dS(NRRRRRhR(
t_prog_prefixt
_parser_classt_collectionstOrderedDictt_name_parser_mapt_choices_actionsRRRMR(R"RRItparser_classRRhR((s$/usr/local/lib/python2.7/argparse.pyRM
s				cKs|jddkr/d|j|f|d<nd|kro|jd}|j||}|jj|n|j|}||j|<|S(NRIs%s %sRh(	RR/RRRRRRR(R"R&tkwargsRht
choice_actionR((s$/usr/local/lib/python2.7/argparse.pyt
add_parser"s
cCs|jS(N(R(R"((s$/usr/local/lib/python2.7/argparse.pyR2scCs|d}|d}|jtk	r9t||j|ny|j|}WnHtk
r|dj|jf}td|}t||nX|j|d\}	}x0t
|	jD]\}
}t||
|qW|rt
|jt
gt|t
j|ndS(Niis, sunknown parser %r (choices: %s)(RRR0RR7R!RRtparse_known_argsR/RR+t
setdefaultt_UNRECOGNIZED_ARGS_ATTRR.R(R"RR1RRtparser_nameR$RtmsgtsubnamespacetkeyR'((s$/usr/local/lib/python2.7/argparse.pyR5s 


	N(
RR,R	RRR/RMRRR(((s$/usr/local/lib/python2.7/argparse.pyRs
		cBs/eZdZdddZdZdZRS(sFactory 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.
    tricCs||_||_dS(N(t_modet_bufsize(R"tmodetbufsize((s$/usr/local/lib/python2.7/argparse.pyRMfs	cCs|dkrZd|jkr"tjSd|jkr8tjStd|j}t|nyt||j|jSWn5tk
r}td}t	|||fnXdS(Nt-R
twsargument "-" with mode %rscan't open '%s': %s(
Rt_syststdintstdoutRR8RRtIOErrorR(R"tstringR
teR((s$/usr/local/lib/python2.7/argparse.pyRjscCsB|j|jf}djd|D}dt|j|fS(Ns, css'|]}|dkrt|VqdS(iN(R(t.0R%((s$/usr/local/lib/python2.7/argparse.pys	<genexpr>~ss%s(%s)(RRR!RR(R"RWtargs_str((s$/usr/local/lib/python2.7/argparse.pyR(|s(RR,R-RMRR((((s$/usr/local/lib/python2.7/argparse.pyRYs	cBs8eZdZdZdZdZdZdZRS(sSimple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    cKs)x"|D]}t||||qWdS(N(R0(R"RR&((s$/usr/local/lib/python2.7/argparse.pyRMs
cCs)t|tstSt|t|kS(N(RRtNotImplementedR(R"tother((s$/usr/local/lib/python2.7/argparse.pyt__eq__scCst|tstS||kS(N(RRR(R"R((s$/usr/local/lib/python2.7/argparse.pyt__ne__scCs
||jkS(N(R*(R"R((s$/usr/local/lib/python2.7/argparse.pyt__contains__sN(	RR,R-RMR/t__hash__RRR (((s$/usr/local/lib/python2.7/argparse.pyRs			t_ActionsContainercBseZdZdZddZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZdd
ZdZdZdZdZRS(cCsgtt|j||_||_||_||_i|_|jddt
|jddt
|jddt|jddt|jddt
|jddt|jddt|jddt|jdd	t|jdd
t|jddt|jg|_i|_g|_g|_i|_tjd|_g|_dS(
NRmtstoretstore_constt
store_truetstore_falseRtappend_consttcountRhRtparserss^-\d+$|^-\d*\.\d+$(RR"RMtdescriptiontargument_defaulttprefix_charstconflict_handlert_registriestregisterR/RRRRRRRRRRt_get_handlert_actionst_option_string_actionst_action_groupst_mutually_exclusive_groupst	_defaultsRERFt_negative_number_matchert_has_negative_number_optionals(R"R*R,R+R-((s$/usr/local/lib/python2.7/argparse.pyRMs2					
					cCs#|jj|i}|||<dS(N(R.R(R"t
registry_nameR'Rtregistry((s$/usr/local/lib/python2.7/argparse.pyR/scCs|j|j||S(N(R.R(R"R8R'R((s$/usr/local/lib/python2.7/argparse.pyt
_registry_getscKsJ|jj|x3|jD](}|j|kr||j|_qqWdS(N(R5tupdateR1RR(R"RRm((s$/usr/local/lib/python2.7/argparse.pytset_defaultsscCsLx6|jD]+}|j|kr
|jdk	r
|jSq
W|jj|dS(N(R1RRR/R5R(R"RRm((s$/usr/local/lib/python2.7/argparse.pytget_defaultscOs|j}|s6t|dkrl|dd|krl|rWd|krWtdn|j||}n|j||}d|kr|d}||jkr|j||d<q|jdk	r|j|d<qn|j|}t	|s
td|fn||}|j
d|j|j}t	|sStd|fnt|d	ry|j
j|dWqtk
rtd
qXn|j|S(s
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        iiRs+dest supplied twice for positional argumentRsunknown action "%s"Rs%r is not callableRs,length of metavar tuple does not match nargsN(R,RkR8t_get_positional_kwargst_get_optional_kwargsR5R+R/t_pop_action_classRR:RRRRt	TypeErrort_add_action(R"RWRtcharsRtaction_classRmt	type_func((s$/usr/local/lib/python2.7/argparse.pyRts2		-

cOs&t|||}|jj||S(N(t_ArgumentGroupR3R(R"RWRR((s$/usr/local/lib/python2.7/argparse.pytadd_argument_group"scKs#t||}|jj||S(N(t_MutuallyExclusiveGroupR4R(R"RR((s$/usr/local/lib/python2.7/argparse.pytadd_mutually_exclusive_group'scCs|j||jj|||_x|jD]}||j|<q0WxB|jD]7}|jj|rQ|js|jjt	qqQqQW|S(N(
t_check_conflictR1Rt	containerRR2R6tmatchR7R(R"RmR((s$/usr/local/lib/python2.7/argparse.pyRB,s
		cCs|jj|dS(N(R1tremove(R"Rm((s$/usr/local/lib/python2.7/argparse.pyt_remove_actionAscCsOi}xO|jD]D}|j|krGtd}t||jn|||j<qWi}xv|jD]k}|j|kr|jd|jd|jd|j||j<nx"|jD]}||j||<qWqhWxD|jD]9}|j	d|j
}x|jD]}|||<qWqWx*|jD]}|j||j
|q(WdS(Ns.cannot merge actions - two groups are named %rttitleR*R-R(R3RORR8RGR*R-RR4RIRR1RRB(R"RKttitle_group_mapRR
t	group_mapRmtmutex_group((s$/usr/local/lib/python2.7/argparse.pyt_add_container_actionsDs,				cKsd|kr'td}t|n|jdttgkrOt|d<n|jdtkr}d|kr}t|d<nt|d|dgS(NRs1'required' is an invalid argument for positionalsRRRR(RRARRRRR(R"RRR
((s$/usr/local/lib/python2.7/argparse.pyR>ls
!
c
OsVg}g}x|D]}|d|jkrZtd}||jf}t||n|j||d|jkrt|dkr|d|jkr|j|qqqqW|jdd}|dkr@|r|d}	n
|d}	|	j|j}|s+td}t||n|jdd}nt	|d|d|S(	Nis8invalid option string %r: must start with a character %riRs%dest= is required for options like %rRRR(
R,RR8RRkRR/tlstriptreplaceR(
R"RWRRtlong_option_stringsRR
RRtdest_option_string((s$/usr/local/lib/python2.7/argparse.pyR?|s.



cCs%|jd|}|jd||S(NRm(RR:(R"RRRm((s$/usr/local/lib/python2.7/argparse.pyR@scCsUd|j}yt||SWn0tk
rPtd}t||jnXdS(Ns_handle_conflict_%ss%invalid conflict_resolution value: %r(R-R.RRR8(R"thandler_func_nameR
((s$/usr/local/lib/python2.7/argparse.pyR0s

cCsrg}xC|jD]8}||jkr|j|}|j||fqqW|rn|j}|||ndS(N(RR2RR0(R"Rmtconfl_optionalsRtconfl_optionalR-((s$/usr/local/lib/python2.7/argparse.pyRJs
cCsKtd}djg|D]\}}|^q}t|||dS(Ns conflicting option string(s): %ss, (RR!R(R"Rmtconflicting_actionsRRtconflict_string((s$/usr/local/lib/python2.7/argparse.pyt_handle_conflict_errors	cCsZxS|D]K\}}|jj||jj|d|js|jj|qqWdS(N(RRMR2RR/RKRN(R"RmR[R((s$/usr/local/lib/python2.7/argparse.pyt_handle_conflict_resolves
	N(RR,RMR/R/R:R<R=RtRGRIRBRNRSR>R?R@R0RJR]R^(((s$/usr/local/lib/python2.7/argparse.pyR"s$	4				
	/					(		#				RFcBs)eZdddZdZdZRS(cKs|j}|d|j|d|j|d|jtt|j}|d||||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS(NR-R,R+R*(RR-R,R+RRFRMRORR.R1R2R5R7R4(R"RKROR*RR;t
super_init((s$/usr/local/lib/python2.7/argparse.pyRMs			cCs,tt|j|}|jj||S(N(RRFRBRR(R"Rm((s$/usr/local/lib/python2.7/argparse.pyRBscCs*tt|j||jj|dS(N(RRFRNRRM(R"Rm((s$/usr/local/lib/python2.7/argparse.pyRNsN(RR,R/RMRBRN(((s$/usr/local/lib/python2.7/argparse.pyRFs	RHcBs&eZedZdZdZRS(cCs,tt|j|||_||_dS(N(RRHRMRt
_container(R"RKR((s$/usr/local/lib/python2.7/argparse.pyRMs	cCsJ|jr$td}t|n|jj|}|jj||S(Ns-mutually exclusive arguments must be optional(RRR8R`RBRR(R"RmR
((s$/usr/local/lib/python2.7/argparse.pyRBs	cCs$|jj||jj|dS(N(R`RNRRM(R"Rm((s$/usr/local/lib/python2.7/argparse.pyRNs(RR,RRMRBRN(((s$/usr/local/lib/python2.7/argparse.pyRHs	c
BsUeZdZd!d!d!d!d!gedd!d!dedZdZdZdZ	dZ
dZd!d!d	Zd!d!d
Z
dZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZd!dZd!dZd!dZd!dZ dd!dZ!d Z"RS("saObject for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default: 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
    Rterrorc
Cs|dk	r+ddl}
|
jdtntt|j}|d|d|d|
d||dkrtjj	t
jd}n||_||_
||_||_||_|	|_||_|j}|td|_|td	|_d|_d
}|jdd|d|kr-dn|d}|jrw|j|d
|dddddtdtdn|jr|j|d|dddddtd|jdtdnxL|D]D}|j|y
|j}Wntk
rqX|jj|qWdS(NisThe "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action='version', version="N", ...)" insteadR*R,R+R-ispositional argumentssoptional argumentscSs|S(N((R((s$/usr/local/lib/python2.7/argparse.pytidentityFsRRthiRhRmRsshow this help message and exittvRs&show program's version number and exit(R/twarningstwarntDeprecationWarningRRRMR5tpathtbasenameRtargvRIRctepilogRtformatter_classtfromfile_prefix_charstadd_helpRGRt_positionalst
_optionalst_subparsersR/RtRRSR5RR;(R"RIRcR*RkRtparentsRlR,RmR+R-RnRet	superinitt	add_groupRbtdefault_prefixRRtdefaults((s$/usr/local/lib/python2.7/argparse.pyRMsX
													



cCsAdddddddg}g|D]}|t||f^q"S(NRIRcR*RRlR-Rn(R.(R"RR&((s$/usr/local/lib/python2.7/argparse.pyR fs	c	KsG|jdk	r%|jtdn|jdt|d|ksSd|krt|jdd}t|jdd}|j|||_n|j|_|j	ddkr|j
}|j}|j}|j
|j||d|jj|d<n|j|d}|d	g|}|jj||S(
Ns(cannot have multiple subparser argumentsRROR*tsubcommandsRIRTR)R(RqR/RaRRRRRGRoRRt_get_positional_actionsR4RgRcRZRwR@RB(	R"RROR*RQRRet
parsers_classRm((s$/usr/local/lib/python2.7/argparse.pytadd_subparsersus$	cCs0|jr|jj|n|jj||S(N(RRpRBRo(R"Rm((s$/usr/local/lib/python2.7/argparse.pyRBs	cCs#g|jD]}|jr
|^q
S(N(R1R(R"Rm((s$/usr/local/lib/python2.7/argparse.pyt_get_optional_actionss
cCs#g|jD]}|js
|^q
S(N(R1R(R"Rm((s$/usr/local/lib/python2.7/argparse.pyRxs
cCsK|j||\}}|rGtd}|j|dj|n|S(Nsunrecognized arguments: %sRz(RRRaR!(R"RWR1RjR
((s$/usr/local/lib/python2.7/argparse.pyt
parse_argss
cCsv|dkrtjd}nt|}|dkr@t}nx`|jD]U}|jtk	rJt||js|j	tk	rt
||j|j	qqqJqJWx:|jD]/}t||st
|||j|qqWy[|j||\}}t|t
r0|jt|t
t|t
n||fSWn4tk
rqtjd}|jt|nXdS(Ni(R/RRjRRR1RRRRR0R5t_parse_known_argsRRR.tdelattrRtexc_infoRaR(R"RWR1RmRterr((s$/usr/local/lib/python2.7/argparse.pyRs,#
csL	jdk	r!	jnixr	jD]g}|j}xUt|jD]D\}}j|g}|j|| |j||dqPWq1Wig}t}	xt|	D]\}}
|
dkr|j	dx_|	D]}
|j	dqWq	j
|
}|dkr+d}n||<d}|j	|qWdj|ttd	fd
	
fd}
	j
	
fd	}gd
}rt}nd}x||krtgD]}||kr|^q}||krj||}||kra|}qqj|}n|kr||!}j||}n|
|}qW||}j|r	jtdnx	jD]}|kr|jr-t|}	jtd
|q|jdk	rt|jtrt|jr|jt|jkrt|j	j||jqqqWx	jD]}|jrx{|jD]}|krPqqWg|jD]!}|jtk	rt|^q}td}	j|dj|qqWfS(Nis--RtAtORTcsj|j||}||jk	rj|xWj|gD]@}|krNtd}t|}t|||qNqNWn|tk	r|||ndS(Nsnot allowed with argument %s(Rt_get_valuesRRRRRR(Rmtargument_stringsRtargument_valuestconflict_actionR
taction_name(taction_conflictsR1tseen_actionstseen_non_default_actionsR"(s$/usr/local/lib/python2.7/argparse.pyttake_actions

cs|}|\}}}j}g}xtr|dkrVj||dS|dk	ry||d}j}|dkr|d|kr|j|g|f|d}	|	|d}|dpd}
j}||kr||}|
}qvtd}t|||q|dkrW|d}
|g}|j|||fPqtd}t|||q+|d}|}|||}||}
||
!}|j|||fPq+W|stx'|D]\}}}|||qW|
S(NiRisignored explicit argument %r(	t_match_argumentRR/RR,R2RRRO(tstart_indextoption_tupleRmRtexplicit_argtmatch_argumentt
action_tuplest	arg_countRCtchartnew_explicit_argt
optionals_mapR
tstopRWRtselected_patterns(R$targ_strings_patterntextrastoption_string_indicesR"R(s$/usr/local/lib/python2.7/argparse.pytconsume_optionalsP
			
	
	
	



csj}|}||}xEt|D]4\}}|||!}||7}||q2Wt|(|S(N(t_match_arguments_partialtzipRk(Rt
match_partialtselected_patternt
arg_countsRmRRW(R$RRR"R(s$/usr/local/lib/python2.7/argparse.pytconsume_positionalscs	

iistoo few argumentssargument %s is requireds#one of the arguments %s is requiredRz(RmR/t_read_args_from_filesR4RRRRtiterRt_parse_optionalR!RRxR=R<RaRR1RRRRt
basestringRRR.R0t
_get_valueRhR(R"R$R1RRRRtmutex_actiont	conflictstarg_string_pattern_partstarg_strings_itert
arg_stringRtpatternRRRtmax_option_string_indexRtnext_option_string_indextpositionals_end_indextstringst
stop_indexRmR&RRR
((RR$RRR1RRRRR"Rs$/usr/local/lib/python2.7/argparse.pyR}s	

	
		J
	

		 	
!!cCsg}x|D]}|s-|d|jkr=|j|q
yt|d}zjg}xA|jjD]-}x$|j|D]}|j|qWqlW|j|}|j|Wd|jXWq
t	k
rt
jd}|jt
|q
Xq
W|S(Nii(RmRRtreadRtconvert_arg_line_to_argsRRRRRRRaR(R"R$tnew_arg_stringsRt	args_filetarg_lineR%R((s$/usr/local/lib/python2.7/argparse.pyRs$

cCs|gS(N((R"R((s$/usr/local/lib/python2.7/argparse.pyRscCs|j|}tj||}|dkritdd6tdt6tdt6}td|j}|j|j|}t	||nt
|jdS(Nsexpected one argumentsexpected at most one argumentsexpected at least one argumentsexpected %s argument(s)i(t_get_nargs_patternRERLR/RRR
RRRRkR(R"RmRt
nargs_patternRLtnargs_errorsRR
((s$/usr/local/lib/python2.7/argparse.pyRs

c
Csg}xtt|ddD]}|| }djg|D]}|j|^q<}tj||}|dk	r|jg|jD]}	t|	^qPqqW|S(NiiRT(	RRkR!RRERLR/RRe(
R"RdRRRt
actions_sliceRmRRLR((s$/usr/local/lib/python2.7/argparse.pyRs
	",c	Cs|s
dS|d|jkr!dS||jkrJ|j|}||dfSt|dkr`dSd|kr|jdd\}}||jkr|j|}|||fSn|j|}t|dkr"djg|D]\}}}|^q}||f}|jtd|nt|dkrA|\}|S|j	j
|rc|jscdSnd|krsdSd|dfS(Niit=s, s#ambiguous option: %s could match %sRz(R/R,R2Rktsplitt_get_option_tuplesR!RaRR6RLR7(	R"RRmRRt
option_tuplestoptionsRR((s$/usr/local/lib/python2.7/argparse.pyRs:


	"		c
Csg}|j}|d|kr|d|krd|krV|jdd\}}n|}d}x0|jD]A}|j|rl|j|}|||f}|j|qlqlWn|d|kr~|d|kr~|}d}|d }|d}	x|jD]y}||kr<|j|}|||	f}|j|q|j|r|j|}|||f}|j|qqWn|jtd||S(NiiRisunexpected option string: %s(R,RR/R2t
startswithRRaR(
R"RRRCt
option_prefixRRmRtshort_option_prefixtshort_explicit_arg((s$/usr/local/lib/python2.7/argparse.pyRDs8	 
 



cCs|j}|dkrd}n|tkr3d}nk|tkrHd}nV|tkr]d}nA|tkrrd}n,|tkrd}nddjd	|}|jr|j	dd
}|j	dd
}n|S(Ns(-*A-*)s(-*A?-*)s	(-*[A-]*)s
(-*A[A-]*)s([-AO]*)s(-*A[-AO]*)s(-*%s-*)s-*RRTR(
RR/RRR
R
RR!RRU(R"RmRR((s$/usr/local/lib/python2.7/argparse.pyRps$								cCs|jttgkr=y|jdWq=tk
r9q=Xn|r|jtkr|jrh|j}n	|j}t	|t
r|j||}|j||qnq|r|jt
kr|jr|jdk	r|j}n|}|j||nt|dkrQ|jdtgkrQ|\}|j||}|j||n|jtkrg|D]}|j||^qg}n|jtkrg|D]}|j||^q}|j||dnFg|D]}|j||^q}x|D]}|j||qW|S(Ns--ii(RRR
RMR8RRRRRRRt_check_valueRR/Rk(R"RmR$R'RRd((s$/usr/local/lib/python2.7/argparse.pyRs>
		
'	(%%
cCs
|jd|j|j}t|sItd}t|||ny||}Wntk
rt|jdt|j}tt	j
d}t||nZttfk
rt|jdt|j}td}t||||fnX|S(NRs%r is not callableRisinvalid %s value: %r(
R:RRRRRR.RRRRRAR8(R"RmRRER
RR&((s$/usr/local/lib/python2.7/argparse.pyRs
cCse|jdk	ra||jkra|djtt|jf}td|}t||ndS(Ns, s#invalid choice: %r (choose from %s)(RR/R!tmapRRR(R"RmR'RR
((s$/usr/local/lib/python2.7/argparse.pyRs!cCs2|j}|j|j|j|j|jS(N(RRgRcR1R4RZ(R"RQ((s$/usr/local/lib/python2.7/argparse.pytformat_usages
cCs|j}|j|j|j|j|j|jxK|jD]@}|j|j	|j|j|j
|j|jqBW|j|j
|jS(N(RRgRcR1R4RaR*R3R]RORuRR^RkRZ(R"RQtaction_group((s$/usr/local/lib/python2.7/argparse.pyRZs
cCsBddl}|jdt|j}|j|j|jS(NiskThe format_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.(ReRfRgRRaRRZ(R"ReRQ((s$/usr/local/lib/python2.7/argparse.pytformat_version	scCs|jd|jS(NRI(RlRI(R"((s$/usr/local/lib/python2.7/argparse.pyR	scCs2|dkrtj}n|j|j|dS(N(R/RRt_print_messageR(R"tfile((s$/usr/local/lib/python2.7/argparse.pytprint_usage 	scCs2|dkrtj}n|j|j|dS(N(R/RRRRZ(R"R((s$/usr/local/lib/python2.7/argparse.pyR%	scCs6ddl}|jdt|j|j|dS(NisjThe print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.(ReRfRgRR(R"RRe((s$/usr/local/lib/python2.7/argparse.pyt
print_version*	s
cCs2|r.|dkrtj}n|j|ndS(N(R/Rtstderrtwrite(R"RR((s$/usr/local/lib/python2.7/argparse.pyR2	sicCs-|r|j|tjntj|dS(N(RRRR(R"tstatusR((s$/usr/local/lib/python2.7/argparse.pyR;	scCs7|jtj|jdtd|j|fdS(serror(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.
        is%s: error: %s
N(RRRRRRI(R"R((s$/usr/local/lib/python2.7/argparse.pyRa@	s	N(#RR,R-R/RRRMR RzRBR{RxR|RR}RRRRRRRRRRRRZRRRRRRRRa(((s$/usr/local/lib/python2.7/argparse.pyRsRB					#						9	,	,	4		
			
		(5R-t__version__t__all__tcollectionsRRRtosR5treREtsysRttextwrapRRRRRRRR
RR
RRRR2RRRRRt	ExceptionRRR	RRRRRRRRRRRRR"RFRHR(((s$/usr/local/lib/python2.7/argparse.pyt<module>>sx			
	
	[#%T,1"

Zerion Mini Shell 1.0