Current File : //usr/lib/python2.7/site-packages/requestbuilder/__init__.pyo
�
~!JXc@s�ddlZddlZddlZddlZddlZdZde�kr7y�ejj	ejj
e�d�Ziejj	ed�d6Z
ejddgd	ejd
ejde
�Zej�ejj�ejdkr)ejj�j�jd
�Zee�jdkr)ej�Zq)nWq7q7Xneddid�d6d�d6��Zejd�Zejd�Zdefd��YZ de!fd��YZ"defd��YZ#de#fd��YZ$dS(i����Ns0.7.1t__file__s..s.gittGIT_DIRtgittdescribetstdouttstderrtenvitvtbytestEMPTYcCsdS(Ns''((tself((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyt<lambda>.st__repr__cCsdS(Nt((R
((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR/st__str__tparamssservice.session_argstArgcBs)eZdZd�Zd�Zd�ZRS(sQ
    A command line argument.  Positional and keyword arguments to __init__
    are the same as those to argparse.ArgumentParser.add_argument.

    The value specified by the 'dest' argument (or the one inferred if
    none is specified) is used as the name of the parameter to server
    queries unless send=False is also supplied.
    cOszd|kr[t|dtttf�rCt|jd��|_qd|jd�f|_n	d|_||_||_dS(Ntroute_to(	t
isinstancetlisttsetttupletpoptroutestNonetpargstkwargs(R
RR((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyt__init__As		cCs/t|t�r+t|j�t|j�kStS(N(RRtsortedRtFalse(R
tother((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyt__eq__LscCs,dj|jjdjd�|jD���S(Ns{0}({1})s, css|]}t|�VqdS(N(trepr(t.0targ((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pys	<genexpr>Ts(tformatt	__class__t__name__tjoinR(R
((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyRQs	(R%t
__module__t__doc__RRR(((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR7s		tMutuallyExclusiveArgListcBs)eZdZd�Zd�Zd�ZRS(s�
    Pass Args as positional arguments to __init__ to create a set of
    command line arguments that are mutually exclusive.  If you also
    call the required() method then the user must specify exactly one
    of them.  The recommended way to do that is via chaining it from
    __init__.

    Examples:

        MutuallyExclusiveArgList(Arg('--spam'), Arg('--eggs'))

        MutuallyExclusiveArgList(Arg('--spam'),
                                 Arg('--eggs')).required()
    cGsvt|�dkrYt|dt�rYtjdt�|d|_tj||d�nt	|_tj||�dS(NisXpositional booleans in MutuallyExclusiveArgLists are deprecated; use .required() insteadi(
tlenRtbooltwarningstwarntDeprecationWarningtis_requiredRRR(R
targs((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyRgs%	
	cCs
t|_|S(N(tTrueR/(R
((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pytrequiredss	cCs;dj|jjdjd�|D��|jr4dnd�S(Ns{0}({1}){2}s, css|]}t|�VqdS(N(R (R!titem((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pys	<genexpr>zss.required()R
(R#R$R%R&R2(R
((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyRws	(R%R'R(RR2R(((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR)Ws		tFiltercBs;eZdZeddd�Zd�Zd�Zd�ZRS(s�
    An AWS query API filter.  For APIs that support filtering by
    name/value pairs, adding a Filter to a request's list of filters will
    allow a user to send an output filter to the server with '--filter
    name=value' at the command line.

    The value specified by the 'dest' argument (or the 'name' argument,
    if none is given) is used as the name of a filter in queries.
    cCs(||_||_||_||_dS(N(tnamettypetchoicesthelp(R
R5R6R7R8((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR�s			cCs|j|jd�S(Nt=(t
startswithR5(R
targval((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pytmatches_argval�sc	Csd|kr-dj|�}tj|��n|jdd�\}}y|j|�}Wn;tk
r�dj|||jj�}tj|��nX|jr�||jkr�dj||djg|jD]}t	|�^q���}tj|��n|dkrt
}n||fS(s�
        Given an argument to --filter of the form "<name>=<value>", convert
        the value to the appropriate type by calling self.type on it, then
        return a (name, converted_value) tuple.  If the value's type conversion
        doesn't work then an ArgumentTypeError will result.  If the conversion
        succeeds but does not appear in self.choices when it exists, an
        ArgumentTypeError will result as well.
        R9s*filter '{0}' must have format 'NAME=VALUE'is){0} filter value '{1}' must have type {2}s,{0} filter value '{1}' must match one of {2}s, R
(R#targparsetArgumentTypeErrortsplitR6t
ValueErrorR%R7R&tstrR	(R
R;tmsgR5t	value_strtvaluetchoice((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pytconvert�s$	
.	cCsdj|jjt|j��S(Ns{0}({1})(R#R$R%R R5(R
((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR�sN(	R%R'R(RARRR<RFR(((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR4~s
			tGenericTagFiltercBseZdZd�ZRS(s:
    A filter that accepts "tag:<key>=<value>" values
    cCs|jd�od|kS(Nstag:R9(R:(R
R;((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyR<�s(R%R'R(R<(((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyRG�s((%R=toperatortos.pathtost
subprocessR,t__version__tglobalstpathR&tdirnameRt	repo_pathRtPopentPIPERtwaitRtreadt
returncodeRtstriptlstripR6R%tdecodeR	t
attrgettertPARAMStSESSIONtobjectRRR)R4RG(((s;/usr/lib/python2.7/site-packages/requestbuilder/__init__.pyt<module>s6!

 '3