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: //usr/lib/python3.6/site-packages/awscli/customizations/history/__pycache__/__init__.cpython-36.pyc
3

�T_�@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZeje�Ze�Zdd�Zdd�Zdd�Zdd�Zdd�ZGdd�de
�Z dS)�N)�get_global_history_recorder)�ProfileNotFound)�sqlite3)�BasicCommand)�HISTORY_FILENAME_ENV_VAR)�DEFAULT_HISTORY_FILENAME)�DatabaseConnection)�DatabaseRecordWriter)�
RecordBuilder)�DatabaseHistoryHandler)�ShowCommand)�ListCommandcCs|jdt�dS)Nzsession-initialized)�register�attach_history_handler)�event_handlers�r�/usr/lib/python3.6/__init__.py�register_history_mode$srcCs|jdt�dS)Nzbuilding-command-table.main)r�add_history_commands)rrrr�register_history_commands)srcKs~t||�rztjd�tjjtt�}tjj	tjj
|��sHtjtjj
|��t|�}t
|�}t�}t||�}tj|�tj�dS)NzEnabling CLI history)�_should_enable_cli_history�LOG�debug�os�environ�getrr�path�isdir�dirname�makedirsrr	r
r�HISTORY_RECORDERZadd_handler�enable)�session�parsed_args�kwargsZhistory_filenameZ
connection�writerZrecord_builderZ
db_handlerrrrr.s



rcCsb|jdkrdSy|j�}Wntk
r.dSX|jd�dk}|r^tdkr^|rZtjjd�dS|S)N�historyFZcli_historyZenabledzRcli_history is enabled but sqlite3 is unavailable. Unable to collect CLI history.
)ZcommandZget_scoped_configrrr�sys�stderr�write)r"r#Z
scoped_configZhas_history_enabledrrrr@s
rcKst|�|d<dS)Nr&)�HistoryCommand)Z
command_tabler"r$rrrrVsrc@s0eZdZdZdZded�ded�gZdd�ZdS)	r*r&z�Commands to interact with the history of AWS CLI commands ran over time. To record the history of AWS CLI commands set ``cli_history`` to ``enabled`` in the ``~/.aws/config`` file. This can be done by running:

``$ aws configure set cli_history enabled``Zshow)�nameZ
command_class�listcCs|jdkrtd��dS)NzVusage: aws [options] <command> <subcommand> [parameters]
aws: error: too few arguments)Z
subcommand�
ValueError)�selfr#Zparsed_globalsrrr�	_run_mainhs
zHistoryCommand._run_mainN)	�__name__�
__module__�__qualname__�NAMEZDESCRIPTIONrr
ZSUBCOMMANDSr/rrrrr*Zs
r*)!rr'ZloggingZbotocore.historyrZbotocore.exceptionsrZ
awscli.compatrZawscli.customizations.commandsrZ'awscli.customizations.history.constantsrrZ awscli.customizations.history.dbrr	r
rZ"awscli.customizations.history.showrZ"awscli.customizations.history.listr
Z	getLoggerr0rr rrrrrr*rrrr�<module>
s,