ó ÂtÚ_c@sdZddlZddlmZddlmZddlmZddlm Z ddlm Z ej dƒZ d e fd „ƒYZd „Zd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(sAbstractions for CLI arguments. This module contains abstractions for representing CLI arguments. This includes how the CLI argument parser is created, how arguments are serialized, and how arguments are bound (if at all) to operation arguments. The BaseCLIArgument is the interface for all arguments. This is the interface expected by objects that work with arguments. If you want to implement your own argument subclass, make sure it implements everything in BaseCLIArgument. Arguments generally fall into one of several categories: * global argument. These arguments may influence what the CLI does, but aren't part of the input parameters needed to make an API call. For example, the ``--region`` argument specifies which region to send the request to. The ``--output`` argument specifies how to display the response to the user. The ``--query`` argument specifies how to select specific elements from a response. * operation argument. These are arguments that influence the parameters we send to a service when making an API call. Some of these arguments are automatically created directly from introspecting the JSON service model. Sometimes customizations may provide a pseudo-argument that takes the user input and maps the input value to several API parameters. iÿÿÿÿN(t xform_name(tfirst_non_none_response(tunpack_cli_arg(tSchemaTransformer(tmodelsawscli.argumentstUnknownArgumentErrorcBseZRS((t__name__t __module__(((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR4scCs:tƒ}|j|ƒ}tj|ƒ}|jdƒ}|S(Nt InputShape(Rt transformRt ShapeResolvertget_shape_by_name(tschemat transformert shapes_maptshape_resolvert arg_shape((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyt!create_argument_model_from_schema8s  tBaseCLIArgumentcBsøeZdZd„Zd„Zd„Zd„Zed„ƒZed„ƒZ ed„ƒZ ed„ƒZ ed „ƒZ ed „ƒZ ed „ƒZed „ƒZed „ƒZed„ƒZed„ƒZejd„ƒZed„ƒZRS(ssInterface for CLI argument. This class represents the interface used for representing CLI arguments. cCs ||_dS(N(t_name(tselftname((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyt__init__MscCs|||jscCs|jS(N(R>(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR/BscCs|jS(N(RA(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR+FscCs|jS(N(R?(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR-JscCs|jS(N(R;(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR.NsN(RRR0R(R,RRDR1RRR!R2R"RR#R)R/R+R-R.(((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR3Ás&        t CLIArgumentcBs eZdZi ed6ed6ed6ed6ed6ed6ed6ed6ed 6ed 6ed 6Zedd „Z e d „ƒZ e d„ƒZ e jd„ƒZ e d„ƒZejd„ƒZe d„ƒZe d„ƒZd„Zd„Zd„Zd„Zd„ZRS(sARepresents a CLI argument that maps to a service parameter. t structuretmapt timestampR4RQtfloattintegertlongRPtdoubletblobcCs[||_|dkr|}n||_||_||_||_||_|j|_dS(s= :type name: str :param name: The name of the argument in "cli" form (e.g. ``min-instances``). :type argument_model: ``botocore.model.Shape`` :param argument_model: The shape object that models the argument. :type argument_model: ``botocore.model.OperationModel`` :param argument_model: The object that models the associated operation. :type event_emitter: ``botocore.hooks.BaseEventHooks`` :param event_emitter: The event emitter to use when emitting events. This class will emit events during parts of the argument parsing process. This event emitter is what is used to emit such events. :type is_required: boolean :param is_required: Indicates if this parameter is required or not. N( RR(t_serialized_nameRCR:t_operation_modelt_event_emitterR"t_documentation(RRRCtoperation_modelt event_emittert is_requiredtserialized_name((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyRfs        cCs|jjddƒS(NR$R%(RR&(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR'scCs|jS(N(R:(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR!‘scCs ||_dS(N(R:(RR((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR!•scCs|jS(N(R`(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR"™scCs ||_dS(N(R`(RR((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR"scCs |jjS(N(RCRE(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR¡scCs|jj|jjtƒS(N(tTYPE_MAPtgetRCRERR(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR#¥scCs5|j}|j|d|jd|jd|jƒdS(sX See the ``BaseCLIArgument.add_to_parser`` docs for more information. thelpRKR!N(RRLR"R#R!(RRR((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR©s    cCsI|dkrdS|j|ƒ}tjd||j|ƒ|||jR8( RRRCRaRbRcRIRGR/RHRd((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyRûs      cCs |dk r|||j(R((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyR/1sN( RRR0R,R(RRRRR1R/(((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyRyês     (R0tloggingtbotocoreRtbotocore.hooksRtawscli.argprocessRt awscli.schemaRRt getLoggerRit ExceptionRRtobjectRR3RTRwRy(((s;/opt/awscli/lib/python2.7/site-packages/awscli/arguments.pyt&s  |’