HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/configure/__pycache__/configure.cpython-36.pyc
3

�T_G�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZd
dlmZmZeje�Zdd
�ZGdd�de�ZGdd�de�ZdS)�N)�ProfileNotFound)�compat_input)�BasicCommand)�AddModelCommand)�ConfigureSetCommand)�ConfigureGetCommand)�ConfigureListCommand)�ConfigFileWriter�)�
mask_value�profile_to_sectioncCs|jdtj�dS)Nzbuilding-command-table.main)�register�ConfigureCommandZadd_command)Zcli�r�/usr/lib/python3.6/configure.py�register_configure_cmd src@seZdZddd�ZdS)�InteractivePrompter�cCs,|dkrt|�}td||f�}|s(d}|S)N�aws_access_key_id�aws_secret_access_keyz	%s [%s]: )rr)rr)�self�
current_value�config_name�prompt_textZresponserrr�	get_value'szInteractivePrompter.get_valueN)r)�__name__�
__module__�__qualname__rrrrrr%srcsreZdZdZej�ZdZdZde	d�de
d�ded�ded�gZ
ddddgZd�fdd�	Zdd�Zdd�Z�ZS)rZ	configurez&aws configure [--profile profile-name]a�To create a new configuration::

    $ aws configure
    AWS Access Key ID [None]: accesskey
    AWS Secret Access Key [None]: secretkey
    Default region name [None]: us-west-2
    Default output format [None]:

To update just the region name::

    $ aws configure
    AWS Access Key ID [****]:
    AWS Secret Access Key [****]:
    Default region name [us-west-1]: us-west-2
    Default output format [None]:
�list)�nameZ
command_class�get�setz	add-modelr�AWS Access Key IDr�AWS Secret Access Key�region�Default region name�output�Default output formatNcs<tt|�j|�|dkrt�}||_|dkr2t�}||_dS)N)�superr�__init__r�	_prompterr	�_config_writer)rZsessionZprompterZ
config_writer)�	__class__rrr)XszConfigureCommand.__init__c
Cs�i}y|jj�}Wntk
r*i}YnXxD|jD]:\}}|j|�}|jj|||�}|dk	r4||kr4|||<q4Wtjj	|jj
d��}	|r�|jj}
|j||
�|
dk	r�t
|
�}||d<|jj||	�dS)NZconfig_file�__section__)�_sessionZget_scoped_configr�VALUES_TO_PROMPTr r*r�os�path�
expanduser�get_config_variable�profile�_write_out_creds_file_valuesrr+�
update_config)rZparsed_argsZparsed_globals�
new_values�configrrrZ	new_valueZconfig_filenamer4Zsectionrrr�	_run_mainas(


zConfigureCommand._run_maincCsji}d|kr|jd�|d<d|kr0|jd�|d<|rf|dk	rD||d<tjj|jjd��}|jj||�dS)Nrrr-Zcredentials_file)�popr0r1r2r.r3r+r6)rr7Zprofile_nameZcredential_file_valuesZshared_credentials_filenamerrrr5zs

z-ConfigureCommand._write_out_creds_file_values)rr")rr#)r$r%)r&r')NN)rrr�NAMErZ	FROM_FILEZDESCRIPTIONZSYNOPSISZEXAMPLESrrrrZSUBCOMMANDSr/r)r9r5�
__classcell__rr)r,rr3s	r)r0ZloggingZbotocore.exceptionsrZ
awscli.compatrZawscli.customizations.commandsrZ(awscli.customizations.configure.addmodelrZ#awscli.customizations.configure.setrZ#awscli.customizations.configure.getrZ$awscli.customizations.configure.listrZ&awscli.customizations.configure.writerr	rrrZ	getLoggerrZloggerr�objectrrrrrr�<module>
s