File: //lib/python3/dist-packages/awscli/customizations/__pycache__/commands.cpython-38.pyc
U
<�^�B � @ s� d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z d dl
Z
d dlmZ d dl
mZmZ d dlmZmZ d d lmZ d d
lmZ d dlmZ d dlmZ e �e�ZeZG d
d� de �Z!G dd� de�Z"G dd� de�Z#G dd� de�Z$dS )� N)�model)�OrderedDict��validate_parameters)� docevents)�ArgTableArgParser)�unpack_argument�unpack_cli_arg)�CustomArgument�!create_argument_model_from_schema)�OperationDocumentEventHandler)�
CLICommand)�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/dist-packages/awscli/customizations/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 sh | � � | _| �� | _dd�| j� }| jj|| j|| jd� t| j | j
�}|�|�\}}t|��
� D ]�\}}d } |�dd�}
|
| j kr�| j |
} t| jd| j| |�}| �| |�r�| jjdd| jf | |d d�}|d k r�|}n
t| |�}| �| j|� t|||� qdt|d ��r| �||� nHt|d
d �d k�rR|�rFtdd�|� ��| �||�S | j
|j ||�S d S )
Nz(before-building-argument-table-parser.%s�.)Zargument_table�argsr'