https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/awscli/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/awscli/__pycache__/clidriver.cpython-310.pyc
o

.&�a�i�@sddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZddl
mZddl
mZddl
mZdd	lmZdd
lmZmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddl#m$Z$ddl#m%Z%ddl#m&Z&ddl'm(Z(ddl'm)Z)ddl'm*Z*ddl'm+Z+ddl'm,Z,ddl-m.Z.ddl/m0Z0ddl/m1Z1ddl2m3Z3dd l2m4Z4e�5d!�Z6d"Z7e�Z8d#�9d$�d%d&�Z:d'd(�Z;d)d*�Z<Gd+d,�d,e=�Z>Gd-d.�d.e�Z?Gd/d0�d0e=�Z@Gd1d2�d2e=�ZAdS)3�N)�__version__)�HierarchicalEmitter)�
xform_name)�copy_kwargs�OrderedDict)�NoCredentialsError)�
NoRegionError)�ProfileNotFound)�get_global_history_recorder)�EnvironmentVariablesr)�get_stderr_text_writer)�
get_formatter)�load_plugins)�
CLICommand)�six)�
MainArgParser)�ServiceArgParser��ArgTableArgParser)�USAGE)�ProviderHelpCommand)�ServiceHelpCommand)�OperationHelpCommand)�CustomArgument)�ListArgument)�BooleanArgument)�CLIArgument)�UnknownArgumentError)�unpack_argument)�AliasLoader)�AliasCommandInjector)� emit_top_level_args_parsed_event)�write_exceptionzawscli.clidriverzE%(asctime)s - %(threadName)s - %(name)s - %(levelname)s - %(message)s��idnacCs t�}|��}t�d|d�|S)N�CLI_RC�CLI)�create_clidriver�main�HISTORY_RECORDER�record)�driver�rc�r-�2/usr/lib/python3/dist-packages/awscli/clidriver.pyr(Dsr(cCs>tj�t�}t|�t|j�di�|�d�d�t	|d�}|S)N�plugins�
event_emitter)�event_hooks��session)
�botocorer3�Sessionr�_set_user_agent_for_sessionr�full_config�get�
get_component�	CLIDriver)r3r+r-r-r.r'Ks�
r'cCsd|_t|_dt|_dS)Nzaws-clizbotocore/%s)�user_agent_namer�user_agent_version�botocore_version�user_agent_extrar2r-r-r.r6Tsr6c@s�eZdZd dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d dd�Zdd�Zdd�Zdd�ZdS)!r:NcCsF|durtj�t�|_t|j�n||_d|_d|_d|_t�|_	dS�N)
r4r3�get_sessionrr6�	_cli_data�_command_table�_argument_tabler�alias_loader��selfr3r-r-r.�__init__\szCLIDriver.__init__cCs|jdur|j�d�|_|jS)N�cli)rAr3�get_data�rFr-r-r.�
_get_cli_datags
zCLIDriver._get_cli_datacC�|jdur
|��|_|jSr?)rB�_build_command_tablerJr-r-r.�_get_command_tableo�

zCLIDriver._get_command_tablecCrLr?)rC�_build_argument_tablerJr-r-r.�_get_argument_tabletrOzCLIDriver._get_argument_tablecCs&|�|j�}|jjd||j|d�|S)z�
        Create the main parser to handle the global arguments.

        :rtype: ``argparser.ArgumentParser``
        :return: The parser object

        zbuilding-command-table.main��
command_tabler3�command_object)�_build_builtin_commandsr3�emit�rFrSr-r-r.rMys�zCLIDriver._build_command_tablecCs0t�}|��}|D]}t||j|d�||<q	|S)N)�cli_namer3�service_name)r�get_available_services�ServiceCommandr3)rFr3�commands�servicesrYr-r-r.rU�s�z!CLIDriver._build_builtin_commandscCs(|�|�}t|j|j�}|�||�dSr?)�_create_parserr r3rD�inject_aliases)rFrS�parser�injectorr-r-r.�_add_aliases�s

�zCLIDriver._add_aliasescCsZt�}|��}|�dd�}|D]}t||�}|�||�}|�|�q|jjd|d�|S)N�optionszbuilding-top-level-params)�argument_table)rrKr8r�_create_cli_argument�add_to_arg_tabler3rV)rFrd�cli_data�
cli_arguments�option�
option_params�cli_argumentr-r-r.rP�s�zCLIDriver._build_argument_tablecCsDt||�dd�|�d�|�d�|�d�|�d�|�d�|�d�d	�S)
N�helpr#�dest�default�action�required�choices�type)�	help_textrmrnrorprq�
cli_type_name)rr8)rF�option_namerjr-r-r.re�s�zCLIDriver._create_cli_argumentc
Cs<|��}t|j|��|��|�dd�|�dd�|�dd��S)N�description�synopsis�
help_usage)rKrr3rNrQr8)rFrgr-r-r.�create_help_command�s


�zCLIDriver.create_help_commandcCs<|��|d<|��}t||j��|�dd�|��dd�}|S)Nrlrv�aws)�prog)ryrKrr3�
user_agentr8rQ)rFrSrgr`r-r-r.r^�s

�zCLIDriver._create_parserc
Cs�|durtjdd�}|��}|�|�}|�||�|�|�\}}z$|�|�|�|�t�	d|j
��d�t�	d|d�||j||�WSt
yn}ztj�dt�tj�t|��tj�d�WYd}~dSd}~wty�}zd	|}|�|�WYd}~dSd}~wty�}zd
|}|�|�WYd}~dSd}~wty�tj�d�dtjYSty�}ztjdd
d�t�d�t|t�d�WYd}~dSd}~ww)z�

        :param args: List of arguments, with the 'aws' removed.  For example,
            the command "aws s3 list-objects --bucket foo" will have an
            args list of ``['s3', 'list-objects', '--bucket', 'foo']``.

        N��CLI_VERSIONr&�
CLI_ARGUMENTSz
usage: %s
�
�zA%s You can also configure your region by running "aws configure".z=%s. You can configure credentials by running "aws configure".�zException caught in main()T��exc_infozExiting with rc 255)�outfile)�sys�argvrNr^rb�parse_known_args�_handle_top_level_args�_emit_session_eventr)r*r3r|�commandr�stderr�writer�strr�_show_errorr�KeyboardInterrupt�stdout�signal�SIGINT�	Exception�LOG�debugr"r)rF�argsrSr`�parsed_args�	remaining�e�msgr-r-r.r(�sX


���
��
�
��zCLIDriver.maincCs|jjd|j|d�dS)Nzsession-initialized)r3r�)r3rV)rFr�r-r-r.r��s
�zCLIDriver._emit_session_eventcCs*tj|dd�tj�|�tj�d�dS)NTr�r�)r�r�r�r�r�)rFr�r-r-r.r�szCLIDriver._show_errorcCs�t|j|�|jr|j�d|j�|jr|j�d|j�|jr]|jjdtjt	d�|jjdtjt	d�|jjdtjt	d�|jjdtjt	d�t
�d|j���t
�d	tj
d
d��dS|jjdtjd�dS)N�profile�regionr4)�
format_string�awscli�
s3transfer�urllib3zCLI version: %szArguments entered to CLI: %sr})�logger_name�	log_level)r!r3r��set_config_variabler�r��set_stream_logger�logging�DEBUG�
LOG_FORMATr�r|r�r��ERROR)rFr�r-r-r.r�s.����
�z CLIDriver._handle_top_level_argsr?)�__name__�
__module__�__qualname__rGrKrNrQrMrUrbrPreryr^r(r�r�r�r-r-r-r.r:Zs 
	

4
r:c@s�eZdZdZddd�Zedd��Zejdd��Zedd	��Zed
d��Z	e	jdd��Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)r[z�A service command for the CLI.

    For example, ``aws ec2 ...`` we'd create a ServiceCommand
    object that represents the ec2 service.

    NcCs:||_||_d|_|dur||_n||_|g|_d|_dSr?)�_namer3rB�
_service_name�_lineage�_service_model)rFrXr3rYr-r-r.rG)s
zServiceCommand.__init__cC�|jSr?�r�rJr-r-r.�name?�zServiceCommand.namecC�
||_dSr?r��rF�valuer-r-r.r�C�
cCs|��Sr?)�_get_service_modelrJr-r-r.�
service_modelGszServiceCommand.service_modelcCr�r?�r�rJr-r-r.�lineageKr�zServiceCommand.lineagecCr�r?r�r�r-r-r.r�Or�cCrLr?)rB�_create_command_tablerJr-r-r.rNSrOz!ServiceCommand._get_command_tablecCsV|jdur(z
|j�d��|jd�}Wntyd}Ynw|jj|j|d�|_|jS)N�api_versions)�api_version)r�r3�get_config_variabler8r�r	�get_service_model)rFr�r-r-r.r�Xs
�
���z!ServiceCommand._get_service_modelcCs.|��}|�|�\}}|��}||j||�Sr?)r^r�rN�	operation)rFr��parsed_globals�service_parserr�r�rSr-r-r.�__call__cszServiceCommand.__call__cCsxt�}|��}|jD]}t|d�}|�|�}t||j|j|t|j�d�||<q
|jj	d|j||j|d�|�
|�|S)N�-)r��parent_namer3�operation_model�operation_callerzbuilding-command-table.%srR)rr��operation_namesrr��ServiceOperationr�r3�CLIOperationCallerrV�_add_lineage)rFrSr��operation_namerXr�r-r-r.r�ls&


��
z$ServiceCommand._create_command_tablecCs$|D]
}||}|j|g|_qdSr?�r�)rFrSr��command_objr-r-r.r��s�zServiceCommand._add_lineagecCs,|��}t|j|��|dd�|j�|jd�S)N�.)r3�objrS�	arg_table�event_classr�)rNrr3r��join�
lineage_namesr�rWr-r-r.ry�s
�z"ServiceCommand.create_help_commandcCs"|��}|��|d<t||jd�S)Nrl)�operations_tablerY)rNryrr�rWr-r-r.r^�s
�zServiceCommand._create_parserr?)r�r�r��__doc__rG�propertyr��setterr�r�rNr�r�r�r�ryr^r-r-r-r.r[ s(





		r[c@s�eZdZdZeed�ZeZdd�Z	e
dd��Zejdd��Ze
dd	��Z
e
jd
d	��Z
e
dd��Ze
d
d��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"r�z�A single operation of a service.

    This class represents a single operation for a service, for
    example ``ec2.DescribeInstances``.

    )�list�booleancCs@d|_||_||_||_|g|_||_||_|jrd|_dSdS)aT

        :type name: str
        :param name: The name of the operation/subcommand.

        :type parent_name: str
        :param parent_name: The name of the parent command.

        :type operation_model: ``botocore.model.OperationModel``
        :param operation_object: The operation model
            associated with this subcommand.

        :type operation_caller: ``CLIOperationCaller``
        :param operation_caller: An object that can properly call the
            operation.

        :type session: ``botocore.session.Session``
        :param session: The session object.

        NT)	�
_arg_tabler��_parent_name�_operation_callerr��_operation_model�_session�
deprecated�
_UNDOCUMENTED)rFr�r�r�r�r3r-r-r.rG�s
�zServiceOperation.__init__cCr�r?r�rJr-r-r.r��r�zServiceOperation.namecCr�r?r�r�r-r-r.r��r�cCr�r?r�rJr-r-r.r��r�zServiceOperation.lineagecCr�r?r�r�r-r-r.r��r�cCsdd�|jD�S)NcSsg|]}|j�qSr-)r�)�.0�cmdr-r-r.�
<listcomp>�sz2ServiceOperation.lineage_names.<locals>.<listcomp>r�rJr-r-r.r��szServiceOperation.lineage_namescCrLr?)r��_create_argument_tablerJr-r-r.r��s

zServiceOperation.arg_tablec
Csd|j|jf}|j||j||jd�|�|j�}|�|�|�|�\}}|jdkr3|�	�}|||�S|jr<|�
|j�|rGtdd�|���d|j|jf}|j|||d�|�
||j�}d|j|jf}|j||||d	�}	|	dur|t|	t�rz|	�|	S|j�|jjj|jj||�S)
Nz+before-building-argument-table-parser.%s.%s)rdr�r3rlzUnknown options: %sz, zoperation-args-parsed.%s.%s)r�r�zcalling-command.%s.%s)�call_parametersr�r�)r�r��_emitr�r��_create_operation_parser�	_add_helpr�rlry�appendrr��_build_call_parameters�_emit_first_non_none_response�
isinstancer�r��invoker�r�rYr�)
rFr�r��event�operation_parserr�r��op_helpr��overrider-r-r.r��sZ
��


������

�zServiceOperation.__call__cCs"t|j|j|j|jd�|j�d�S)Nr�)r�r�r�r�)rr�r�r�r�r�r�rJr-r-r.rys�z$ServiceOperation.create_help_commandcCs|jddd�dS)Nrl�?)�nargs)�add_argument)rFr`r-r-r.r�szServiceOperation._add_helpcCsLi}t|�}|��D]}|j}||vr#||}|�||�}|�||�q
|Sr?)�vars�values�py_name�_unpack_arg�
add_to_params)rFr�r��service_paramsr��
arg_objectr�r�r-r-r.r�%s�z'ServiceOperation._build_call_parameterscCs,|j}|jjj}t|jd�}t|||||�S)Nr�)r�r�r��endpoint_prefixrr�r)rFrkr�r3rYr�r-r-r.r�4s
�zServiceOperation._unpack_argc
	Cs�t�}|jj}g}i}|dur|j}|j}|��D]6\}}t|d�}|j�|j	|j
�}|j�dd�}	||vo8|	}
|j�
d�}||||
|j||d�}|�|�qt�|�|jd|j|jf|j|j||d�|S)Nr��idempotencyTokenFr0)r��argument_model�is_requiredr��serialized_namer0zbuilding-argument-table.%s.%s)r�r3r�rd)rr��input_shape�required_members�members�itemsr�	ARG_TYPESr8�	type_name�DEFAULT_ARG_CLASS�metadatar�r9rfr�r�r�r�r�)
rFrdr�required_arguments�arg_dict�arg_name�	arg_shape�cli_arg_name�	arg_class�is_tokenrr0r�r-r-r.r�>sD

��

��z'ServiceOperation._create_argument_tablecK�|jj|fi|��Sr?)r�rV�rFr��kwargsr-r-r.r�^szServiceOperation._emitcKrr?)r��emit_first_non_none_responserr-r-r.r�as
��z.ServiceOperation._emit_first_non_none_responsecCst|�}|Sr?r)rFr�r`r-r-r.r�esz)ServiceOperation._create_operation_parserN)r�r�r�r�rrrrr
rGr�r�r�r�r�r�r�ryr�r�r�r�r�r�r�r-r-r-r.r��s8�"





6
 r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�z.Call an AWS operation and format the response.cCr�r?)r�rEr-r-r.rGns
zCLIOperationCaller.__init__cCs<|jj||j|j|jd�}|�||||�}|�|||�dS)a�Invoke an operation and format the response.

        :type service_name: str
        :param service_name: The name of the service.  Note this is the service name,
            not the endpoint prefix (e.g. ``ses`` not ``email``).

        :type operation_name: str
        :param operation_name: The operation name of the service.  The casing
            of the operation name should match the exact casing used by the service,
            e.g. ``DescribeInstances``, not ``describe-instances`` or
            ``describe_instances``.

        :type parameters: dict
        :param parameters: The parameters for the operation call.  Again, these values
            have the same casing used by the service.

        :type parsed_globals: Namespace
        :param parsed_globals: The parsed globals from the command line.

        :return: None, the result is displayed through a formatter, but no
            value is returned.

        )�region_name�endpoint_url�verifyr)r��
create_clientr�r�
verify_ssl�_make_client_call�_display_response)rFrYr��
parametersr��client�responser-r-r.r�qs��zCLIOperationCaller.invokecCsRt|�}|�|�r|jr|�|�}|jdi|��}|St|t|��di|��}|S)Nr-)r�can_paginate�paginate�
get_paginator�getattr)rFrr�rr��py_operation_name�	paginatorr r-r-r.r�s
��z$CLIOperationCaller._make_client_callcCs2|j}|dur
|j�d�}t||�}|||�dS)N�output)r'r�r�r
)rF�command_namer r�r'�	formatterr-r-r.r�s

z$CLIOperationCaller._display_responseN)r�r�r�r�rGr�rrr-r-r-r.r�js!r�)Br�r�r��botocore.sessionr4rr=�botocore.hooksrr�botocore.compatrr�botocore.exceptionsrrr	�botocore.historyr
r�r�
awscli.compatr�awscli.formatterr
�
awscli.pluginr�awscli.commandsrr�awscli.argparserrrrr�awscli.helprrr�awscli.argumentsrrrrr�awscli.argprocessr�awscli.aliasrr �awscli.utilsr!r"�	getLoggerr�r�r)�encoder(r'r6�objectr:r[r�r�r-r-r-r.�<module>sb
�

	GvU

https://t.me/RX1948 - 2025