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__/clidocs.cpython-310.pyc
o

.&�a<r�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZmZmZe�e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)�N)�
xform_name)�StringShape)�is_json_value_header)�SCALAR_TYPES)�ParamShorthandDocGen)�
DOC_EVENTS)�
TopicTagDB)�%find_service_and_method_in_event_name�is_document_type�operation_uses_document_typesc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�CLIDocumentEventHandlercCs,||_|�|j|j�|�|�|_g|_dS�N)�help_command�register�session�event_class�_build_arg_table_groups�_arg_groups�_documented_arg_groups��selfr�r�0/usr/lib/python3/dist-packages/awscli/clidocs.py�__init__!s
z CLIDocumentEventHandler.__init__cCs:i}|j��D]\}}|jdur|�|jg��|�q|Sr
)�	arg_table�items�
group_name�
setdefault�append)rr�
arg_groups�name�argrrrr's
�z/CLIDocumentEventHandler._build_arg_table_groupscCst|�rdSt|�rdS|S)N�JSON�document)rr
)r�shape�defaultrrr�_get_argument_type_name.s
z/CLIDocumentEventHandler._get_argument_type_namecCsvtD]6}|�dd�}t||�r8t||�}t|}t|�d��d}|fd|}	|||	}
||}||
||�qdS)N�-�_�.�)�*)r�replace�hasattr�getattr�len�split)rrr�mapfn�event�event_handler_name�
event_handler�
format_string�num_args�format_args�event_string�	unique_idrrr�
_map_handlers5s

��z%CLIDocumentEventHandler._map_handlerscCs|�|||j�dS)a:
        The default register iterates through all of the
        available document events and looks for a corresponding
        handler method defined in the object.  If it's there, that
        handler method will be registered for the all events of
        that type for the specified ``event_class``.
        N)r:r)rrrrrrrAsz CLIDocumentEventHandler.registercCs |�|jj|jj|jjj�dS)a>
        The default unregister iterates through all of the
        available document events and looks for a corresponding
        handler method defined in the object.  If it's there, that
        handler method will be unregistered for the all events of
        that type for the specified ``event_class``.
        N)r:rrr�
unregister)rrrrr;Ks
�z"CLIDocumentEventHandler.unregistercKs�|j}|jdkrC|j�d�}|�d�|�d�dg}|dd�D]}|�d�|�|�d�|�}|�d	||f�q!|�d
�dSdS)N�manr)�[ z:ref:`aws <cli:aws>`�aws���� . � z:ref:`%s <cli:%s>`� ])�doc�targetrr0�writer�join)rr�kwargsrC�	cmd_names�
full_cmd_list�cmd�
full_cmd_namerrr�doc_breadcrumbsYs





�z'CLIDocumentEventHandler.doc_breadcrumbscKsN|j}|j��|j�dd�}|dkrd|}|�d|�|j�|j�dS)Nr)rAr>zaws z.. _cli:%s:)rC�style�
new_paragraphrr,�writeln�h1r )rrrGrC�	referencerrr�	doc_titlegs
z!CLIDocumentEventHandler.doc_titlecKs,|j}|j�d�|�|j�|j��dS�N�Description)rCrM�h2�include_doc_string�descriptionrN�rrrGrCrrr�doc_descriptionp�z'CLIDocumentEventHandler.doc_descriptioncKs6g|_|j}|j�d�|j��|�d|j�dS)N�Synopsis�%s)rrCrMrU�start_codeblockrOr rXrrr�doc_synopsis_startvs

z*CLIDocumentEventHandler.doc_synopsis_startcKs�|j}|j|}|j|jvr,|j|jvrdSd�dd�|j|jD��}|j�|j�n|j�d�r8d|j}nd|j}|j	sJt
|dd�sJd	|}|�d
|�dS)N� | cSsg|]}|j�qSr��cli_name��.0�arrr�
<listcomp>�sz?CLIDocumentEventHandler.doc_synopsis_option.<locals>.<listcomp>z--z
%s <value>z<%s>�_DOCUMENT_AS_REQUIREDFz[%s]r\)rCrrrrrFrra�
startswith�requiredr.rO)r�arg_namerrGrC�argument�
option_strrrr�doc_synopsis_option}s&

��

�z+CLIDocumentEventHandler.doc_synopsis_optioncKs|j}|j��g|_dSr
)rCrM�
end_codeblockrrXrrr�doc_synopsis_end�s

z(CLIDocumentEventHandler.doc_synopsis_endcKs*|j}|j�d�|js|�d�dSdS)N�Optionsz*None*
)rCrMrUrrErXrrr�doc_options_start�s
�z)CLIDocumentEventHandler.doc_options_startcKs�|j}|j|}|j|jvr,|j|jvrdSd�dd�|j|jD��}|j�|j�nd|j}|�d||�	|j
|j�f�|j�
�|�|j�t|d�r^|�|j
|�|�|j
|�|j��|j��dS)Nr_cSsg|]}d|j�qS)�``%s``r`rbrrrre�sz6CLIDocumentEventHandler.doc_option.<locals>.<listcomp>rqz%s (%s)
�argument_model)rCrrrrrFrrarEr&rr�
cli_type_namerM�indentrV�
documentationr-�_document_enums�_document_nested_structure�dedentrN)rrirrGrCrjr rrr�
doc_option�s,

��

�


z"CLIDocumentEventHandler.doc_optioncKs |jr|j}|j�d�dSdS)NzSee Also)�
related_itemsrCrMrUrXrrr�doc_relateditems_start�s�z.CLIDocumentEventHandler.doc_relateditems_startcKs2|j}|�d�|jjd||d�|�d�dS)N�* zcli:%s��label�text�
)rCrErM�sphinx_reference_label)rr�related_itemrGrCrrr�doc_relateditem�s
�z'CLIDocumentEventHandler.doc_relateditemcCs`t|t�r,|jr.|j��|�d�|j��|jD]
}|j�d|�q|j��dSdSdS)z#Documents top-level parameter enumszPossible values:rqN)	�
isinstancer�enumrMrNrE�start_ul�li�end_ul)r�modelrCr�rrrrv�s




�z'CLIDocumentEventHandler._document_enumsc
Cs�t|dd�}|dkr!|j��D]\}}|j||||jgd�qdS|dkr3|j|d|j|jgd�dS|dkrc|j}|j�dd	�}|j||||jgd�|j	}|j�dd
�}	|j||	||jgd�dSdS)z5Recursively documents parameters in nested structures�	type_nameN�	structure��stack�list��mapr �key�value)
r.�membersr�_doc_memberr �memberr��
serialization�getr�)
rr�rC�member_type_name�member_name�member_shape�	key_shape�key_name�value_shape�
value_namerrrrw�s"
���z2CLIDocumentEventHandler._document_nested_structurecCsh|j|vr|�|j�dkr|jdkr|�d�dS|�|j�z|�||||�W|��dS|��w)N�r�z( ... recursive ... ))r �countr�rEr�_do_doc_member�pop)rrCr�r�r�rrrr��s


�z#CLIDocumentEventHandler._doc_membercCs|j}|�||j�}|r|�d||f�n|�d|�|j��|j��|�|�|j��|j}|dkrK|j�	�D]\}}	|�
|||	|�q=n6|dkrt|j}
|
j�
dd�}|�
|||
|�|j}|j�
dd�}
|�
||
||�n
|dkr�|�
|d	|j|�|j��|j��dS)
Nz
%s -> (%s)z(%s)r�r�r r�r�r�r�)rur&r�rErMrtrNrVr�rr�r�r�r�r�r�rx)rrCr�r�r��docsr�r��sub_name�	sub_shaper�r�r�r�rrrr��s6�



�
z&CLIDocumentEventHandler._do_doc_memberN)�__name__�
__module__�__qualname__rrr&r:rr;rLrRrYr^rlrnrpryr{r�rvrwr�r�rrrrrs*
		rc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�ProviderDocumentEventHandlercK�dSr
r)rr�
event_namerGrrrrL�z,ProviderDocumentEventHandler.doc_breadcrumbscKs0|j}|j�d�|j�|j�|�|j�dS)Nr[)rCrMrU�	codeblock�synopsisrV�
help_usagerXrrrr^sz/ProviderDocumentEventHandler.doc_synopsis_startcKr�r
r�rrirrGrrrrlr�z0ProviderDocumentEventHandler.doc_synopsis_optioncKs|j}|j��dSr
)rCrMrNrXrrrrnsz-ProviderDocumentEventHandler.doc_synopsis_endcKs|j}|j�d�dS)Nro)rCrMrUrXrrrrpsz.ProviderDocumentEventHandler.doc_options_startcKsl|j}|j|}|�d|j|jf�|�|j�|jr4|j�	�|jD]}|j�
|�q$|j��dSdS)Nz``%s`` (%s))rCrrOrarsrVru�choicesrMr�r�r�)rrirrGrCrj�choicerrrry"s

�

�z'ProviderDocumentEventHandler.doc_optioncK� |j}|j�d�|j��dS)NzAvailable Services�rCrMrU�toctreerXrrr�doc_subitems_start.�z/ProviderDocumentEventHandler.doc_subitems_startcKs"|j}d|}|jj||d�dS)N�%s/index��	file_name)rCrM�tocitem)r�command_namerrGrCr�rrr�doc_subitem3sz(ProviderDocumentEventHandler.doc_subitemN)r�r�r�rLr^rlrnrpryr�r�rrrrr�sr�c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�ServiceDocumentEventHandlercKr�r
r�rrrGrrrr^<r�z.ServiceDocumentEventHandler.doc_synopsis_startcKr�r
rr�rrrrl?r�z/ServiceDocumentEventHandler.doc_synopsis_optioncKr�r
rr�rrrrnBr�z,ServiceDocumentEventHandler.doc_synopsis_endcKr�r
rr�rrrrpFr�z-ServiceDocumentEventHandler.doc_options_startcKr�r
rr�rrrryIr�z&ServiceDocumentEventHandler.doc_optioncKr�r
rr�rrr�doc_option_exampleLr�z.ServiceDocumentEventHandler.doc_option_examplecKr�r
rr�rrr�doc_options_endOr�z+ServiceDocumentEventHandler.doc_options_endcKs(|j}|j}|j�d�|�|j�dSrS)rC�objrMrUrVru)rrrGrC�
service_modelrrrrYRsz+ServiceDocumentEventHandler.doc_descriptioncKr�)NzAvailable Commandsr�rXrrrr�Yr�z.ServiceDocumentEventHandler.doc_subitems_startcKsT|j}|j|}t|di�}t|�dkr"d|}|jj||d�dS|j�|�dS)N�subcommand_tablerr�r�)rC�
command_tabler.r/rMr�)rr�rrGrC�
subcommandr�r�rrrr�^s
z'ServiceDocumentEventHandler.doc_subitemN)
r�r�r�r^rlrnrpryr�r�rYr�r�rrrrr�9sr�c@szeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�OperationDocumentEventHandlerz'https://docs.aws.amazon.com/goto/WebAPIcKsF|j}|j}|j�d�|�|j�|�|�|�|�|�|�dSrS)	rCr�rMrUrVru�_add_webapi_crosslink�_add_top_level_args_reference�$_add_note_for_document_types_if_used)rrrGrC�operation_modelrrrrYps

z-OperationDocumentEventHandler.doc_descriptioncCs:|j�d�|j�d�|jjjddd�|j�d�dS)Nr�zSee z
'aws help'z/reference/index)�title�pagez' for descriptions of global parameters.)rCrOrErM�
internal_linkrrrrr�ys�z;OperationDocumentEventHandler._add_top_level_args_referencecCsn|j}|j}|j}|j�d�}|durdS|j��|�d�d|j||j	f}|jj
d|d�|�d�dS)N�uidz
See also: z%s/%s/%szAWS API Documentation)r��linkr�)rCr�r��metadatar�rMrNrE�AWS_DOC_BASEr �
external_linkrO)rrrCr�r��service_uidr�rrrr��s

�z3OperationDocumentEventHandler._add_webapi_crosslinkcCs0t|j�r|jj��|j�d|j�dSdS)NaC``%s`` uses document type values. Document types follow the JSON data model where valid values are: strings, numbers, booleans, null, arrays, and objects. For command input, options and nested parameters that are labeled with the type ``document`` must be provided as JSON. Shorthand syntax does not support document types.)rr�rCrMrNrOr rrrrr��s
���zBOperationDocumentEventHandler._add_note_for_document_types_if_usedTcCsJt|t�r|jr|r|j}d�dd�|D��SdS|jdkr dSd|jS)N�|cSsg|]}d|�qS)z"%s"r)rc�crrrre�szJOperationDocumentEventHandler._json_example_value_name.<locals>.<listcomp>z"string"�booleanz
true|falser\)r�rr�rFr�)rrr�include_enum_valuesr�rrr�_json_example_value_name�s



z6OperationDocumentEventHandler._json_example_value_namecCsf|j|vr|�|j�dkr|jdkr|�d�dS|�|j�z|�|||�W|��dS|��w)Nr�r�z{ ... recursive ... })r r�r�rEr�_do_json_exampler�)rrCrrr�rrr�
_json_example�s


z+OperationDocumentEventHandler._json_examplecCsn|jdkrI|�d�|jjtvr|�d|�|j��n&|j��|j��|�||j|�|j��|�d�|j�	�|j��|�d�dS|jdkr�|�d�|j��|�|j
�}|�d|�|jjtvru|�|�|j��n|j��|�||j|�|j�	�|j��|�d�|j�	�|�d	�dS|jd
kr�|jr�|�
|�dS|�|||�dSdS)Nr��[z%s, ...z...�]r��{z%s: �}r�)r�rEr�rr�rMrt�new_liner�rxr�r�r
�_doc_document_member�_doc_input_structure_members)rrCrrr��
key_stringrrrr��s>
















�z.OperationDocumentEventHandler._do_json_examplecCs|�d�dS)Nz{...})rE)rrCrrrr���z2OperationDocumentEventHandler._doc_document_memberc	Cs|�d�|j��|j��|j}t|�D]f\}}||}|j}|tvr2|�d||�|�f�n8|dkrE|�d|�|�	|||�n%|dkrX|�d|�|�	|||�n|dkrj|�d|�|�	|||�|t
|�dkr||�d�|j��q|j��|j��|�d	�dS)
Nr�z"%s": %sr�z"%s": r�r�r��,r�)rErMrtr�r��	enumerater�rr�r�r/rx)	rrCrrr�r��ir��member_modelr�rrrr��s6



�

�

z:OperationDocumentEventHandler._doc_input_structure_memberscKs�t|�\}}|j}|j|}|j|jvr|j|jvrdS|j}	t�}
|
�|j�rW|
�	|||�}|dur5dS|rW|j
��|�d�|j
�
�|��D]}|�|�qJ|j
��|	dur�|	jdkr�|	jjtvr�|	j}
|j
��|�d�|j
�
�|j|
dd�}|�d||f�t|
t�r�|
jr�|�||
j�|j
��|j
��dS|jtvr�|j
��|�d�|j
�
�|j||	gd�|j
��|j
��dSdS)	NzShorthand Syntaxr��SyntaxF)r�z	%s %s ...zJSON Syntaxr�)r	rCrrrrrrr�supports_shorthand�generate_shorthand_examplerMrNrEr]�
splitlinesrOrmr�r�rr�r�rr��_write_valid_enumsrsr�)rrirr�rG�
service_id�operation_namerC�cli_argumentrr�docgen�example_shorthand_syntax�example_liner��example_typerrrr��sX�
�






�





�z0OperationDocumentEventHandler.doc_option_examplecCs:|j��|�d�|D]	}|�d|�q|�d�dS)NzWhere valid values are:
z    %s
r�)rMrNrE)rrC�enum_valuesr�rrrr�4s


z0OperationDocumentEventHandler._write_valid_enumsc	Ksd|j}|j�d�|j}|j}|dus|js|�d�dS|j��D]
\}}|j|||gd�q"dS)N�Output�Noner�)	rCrMrUr��output_shaper�rErr�)	rrr�rGrCr�r�r�r�rrr�
doc_output;s�z(OperationDocumentEventHandler.doc_outputcKs|�|�dSr
)r�r�rrrr�Fr�z-OperationDocumentEventHandler.doc_options_endN)T)r�r�r�r�rYr�r�r�r�r�r�r�r�r�r�r�r�rrrrr�ls		
#8r�c@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�TopicListerDocumentEventHandlerasThis is the AWS CLI Topic Guide. It gives access to a set of topics that provide a deeper understanding of the CLI. To access the list of topics from the command line, run ``aws help topics``. To access a specific topic from the command line, run ``aws help [topicname]``, where ``topicname`` is the name of the topic as it appears in the output from ``aws help topics``.cCs,||_|�|j|j�t�|_|j��dSr
)rrrrr�
_topic_tag_db�load_json_indexrrrrrSsz(TopicListerDocumentEventHandler.__init__cKs<|j}|jdkr|�d�|jjddd�|�d�dSdS)Nr<r=�cli:awsr>r}rB�rCrDrErMr�rXrrrrLYs

�z/TopicListerDocumentEventHandler.doc_breadcrumbscKs8|j}|j��|jjd|jjdd�|j�d�dS)N�cli:aws help %sr���refnamer�zAWS CLI Topic Guide)rCrMrN�link_target_definitionrr rPrXrrrrR`s

�z)TopicListerDocumentEventHandler.doc_titlecKs,|j}|j�d�|�|j�|j��dSrS)rCrMrUrV�DESCRIPTIONrNrXrrrrYhrZz/TopicListerDocumentEventHandler.doc_descriptioncKr�r
rr�rrrr^nr�z2TopicListerDocumentEventHandler.doc_synopsis_startcKr�r
rr�rrrrnqr�z0TopicListerDocumentEventHandler.doc_synopsis_endcKr�r
rr�rrrrptr�z1TopicListerDocumentEventHandler.doc_options_startcKr�r
rr�rrrr�wr�z/TopicListerDocumentEventHandler.doc_options_endc
Ks�|j}|j�d�|j�d�}|j��}t|���}|D]3}|j�|�|j�	�t||�D]}|j�
|d�}	|�d�|jjd||d�|�d|	�q/q|j�
�|D]}|j�|�qWdS)NzAvailable Topics�categoryrWr|r�r}z: %s
)rCrMrUr��query�get_all_topic_names�sorted�keys�h3rN�get_tag_single_valuerEr��hidden_toctree�hidden_tocitem)
rrrGrC�
categories�topic_names�category_names�
category_name�
topic_namerWrrrr�zs.

�
��
�z2TopicListerDocumentEventHandler.doc_subitems_startN)
r�r�r�rrrLrRrYr^rnrpr�r�rrrrr�Js�r�c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TopicDocumentEventHandlercKsV|j}|jdkr)|�d�|jjddd�|�d�|jjddd�|�d	�dSdS)
Nr<r=r�r>r}r@zcli:aws help topics�topicsrBr�rXrrrrL�s


��z)TopicDocumentEventHandler.doc_breadcrumbscKsH|j}|j��|jjd|jjdd�|j�|jd�}|j�|�dS)Nr�r�rr�)	rCrMrNrrr r�r
rP)rrrGrCr�rrrrR�s

��z#TopicDocumentEventHandler.doc_titlecKs@|j}tj�|jj|jd�}|�|�}|�|�|j	�
�dS)Nz.rst)rC�os�pathrFr��	topic_dirr �_remove_tags_from_contentrOrMrN)rrrGrC�topic_filename�contentsrrrrY�s�

z)TopicDocumentEventHandler.doc_descriptioncCslt|d��}|��}Wd�n1swYd}t|�D]
\}}|�|�s,|}nqd�||d��S)N�rrr�)�open�	readlinesr��
_line_has_tagrF)r�filename�f�lines�content_begin_indexr��linerrrr�s
�
�z3TopicDocumentEventHandler._remove_tags_from_contentcCs*|jjD]}|�d|d�rdSqdS)N�:TF)r��
valid_tagsrg)rr"�tagrrrr�s
�z'TopicDocumentEventHandler._line_has_tagcKr�r
rr�rrrr��r�z,TopicDocumentEventHandler.doc_subitems_startN)	r�r�r�rLrRrYrrr�rrrrr�s
r)�loggingr�botocorer�botocore.modelr�botocore.utilsr�awsclir�awscli.argprocessr�awscli.bcdoc.doceventsr�awscli.topictagsr�awscli.utilsr	r
r�	getLoggerr��LOG�objectrr�r�r�r�rrrrr�<module>s&
n-3_N

https://t.me/RX1948 - 2025