File: //lib/python2.7/site-packages/awscli/arguments.pyc
�
R$�_c @ s d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
e j d � Z d e
f d
� � YZ d � Z d e f d
� � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( s Abstractions 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( t first_non_none_response( t unpack_cli_arg( t SchemaTransformer( t models awscli.argumentst UnknownArgumentErrorc B s e Z RS( ( t __name__t
__module__( ( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyR 4 s c C s: t � } | j | � } t j | � } | j d � } | S( Nt
InputShape( R t transformR t
ShapeResolvert get_shape_by_name( t schemat transformert
shapes_mapt shape_resolvert arg_shape( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyt! create_argument_model_from_schema8 s
t BaseCLIArgumentc B s� e Z d Z d � Z d � Z d � Z d � Z e d � � Z e d � � Z e d � � Z
e d � � Z e d � � Z e d
� � Z
e d � � Z e d � � Z e d
� � Z e d � � Z e d � � Z e j d � � Z e d � � Z RS( ss Interface for CLI argument.
This class represents the interface used for representing CLI
arguments.
c C s
| | _ d S( N( t _name( t selft name( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyt __init__M s c C s | | | j <d S( s� Add this object to the argument_table.
The ``argument_table`` represents the argument for the operation.
This is called by the ``ServiceOperation`` object to create the
arguments associated with the operation.
:type argument_table: dict
:param argument_table: The argument table. The key is the argument
name, and the value is an object implementing this interface.
N( R ( R t argument_table( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyt add_to_arg_tableP s c C s d S( sm Add this object to the parser instance.
This method is called by the associated ``ArgumentParser``
instance. This method should make the relevant calls
to ``add_argument`` to add itself to the argparser.
:type parser: ``argparse.ArgumentParser``.
:param parser: The argument parser associated with the operation.
N( ( R t parser( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyt
add_to_parser] s c C s d S( s Add this object to the parameters dict.
This method is responsible for taking the value specified
on the command line, and deciding how that corresponds to
parameters used by the service/operation.
:type parameters: dict
:param parameters: The parameters dictionary that will be
given to ``botocore``. This should match up to the
parameters associated with the particular operation.
:param value: The value associated with the CLI option.
N( ( R t
parameterst value( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyt
add_to_paramsj s c C s | j S( N( R ( R ( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyR { s c C s d | j S( Ns --( R ( R ( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyt cli_name s c C s t d � � d S( Nt
cli_type_name( t NotImplementedError( R ( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyR � s c C s t d � � d S( Nt required( R ( R ( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyR! � s c C s t d � � d S( Nt
documentation( R ( R ( ( s4 /usr/lib/python2.7/site-packages/awscli/arguments.pyR"