File: //lib/python3.6/site-packages/awscli/customizations/__pycache__/commands.cpython-36.pyc
3
�T_�B � @ s� d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlZd dl m
Z
d dlmZm
Z
d dlmZmZ d dlmZ d d lmZ d d
lmZ d dlmZ d dlmZ e je�ZeZG d
d� de �Z!G dd� de�Z"G dd� de�Z#G dd� de�Z$dS )� N)�model)�OrderedDict)�validate_parameters)�ArgTableArgParser)�unpack_argument�unpack_cli_arg)�CustomArgument�!create_argument_model_from_schema)�OperationDocumentEventHandler)�
CLICommand)� docevents)�HelpCommand)�SchemaTransformerc @ s e Zd Zdd� ZdS )� _FromFilec O s6 d| _ |rtjj|� | _ d|kr,|d | _nt| _dS )aS
``**kwargs`` can contain a ``root_module`` argument
that contains the root module where the file contents
should be searched. This is an optional argument, and if
no value is provided, will default to ``awscli``. This means
that by default we look for examples in the ``awscli`` module.
N�root_module)�filename�os�path�joinr �awscli)�self�paths�kwargs� r �/usr/lib/python3.6/commands.py�__init__ s z_FromFile.__init__N)�__name__�
__module__�__qualname__r r r r r r s r c @ s� e Zd ZdZdZdZdZdZg Zg Z e
Zdd� Zdd� Z
d d
� Zdd� Zd
d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zedd� �Zedd� �Zedd � �Zed!d"� �Zed#d$� �Zejd%d$� �Zd&S )'�BasicCommandz�Basic top level command with no subcommands.
If you want to create a new command, subclass this and
provide the values documented below.
Zcommandnamezdescribe the command� c C s || _ d | _d | _| g| _d S )N)�_session�
_arg_table�_subcommand_table�_lineage)r �sessionr r r r z s zBasicCommand.__init__c C sl | j � | _| j� | _ddj| j� }| jj|| j|| jd� t| j | j
�}|j|�\}}x�t|�j
� D ]�\}}d } |jdd�}
|
| j kr�| j |
} t| jd| j| |�}| j| |�r�| jjdd| jf | |d d�}|d k r�|}n
t| |�}| j| j|� t|||� qfW t|d ��r | j||� nHt|d
d �d k�rV|�rJtddj|� ��| j||�S | j
|j ||�S d S )
Nz(before-building-argument-table-parser.%s�.)Zargument_table�argsr% �_�-Zcustomzprocess-cli-arg.%s.%s)�cli_argument�valueZ operation�help�
subcommandzUnknown options: %s�,)�_build_subcommand_tabler# �_build_arg_tabler"