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

2&�a5�@s�ddlZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZe� d�Z!Gdd�de"�Z#dd�Z$Gdd�de%�Z&Gdd�de&�Z'Gdd�de&�Z(Gdd�de%�Z)Gdd�de)�Z*Gd d!�d!e)�Z+Gd"d#�d#e)�Z,Gd$d%�d%e)�Z-Gd&d'�d'e)�Z.dS)(�N)�Popen�PIPE)�publish_string)�manpage)�ProviderDocumentEventHandler)�ServiceDocumentEventHandler)�OperationDocumentEventHandler)�TopicListerDocumentEventHandler)�TopicDocumentEventHandler)�	docevents)�ReSTDocument)�
TextWriter)�ParamShorthandParser)�ArgTableArgParser)�
TopicTagDB)�
ignore_ctrl_czawscli.helpcseZdZ�fdd�Z�ZS)�ExecutableNotFoundErrorcstt|��d|�dS)Nz$Could not find executable named "%s")�superr�__init__)�self�executable_name��	__class__��-/usr/lib/python3/dist-packages/awscli/help.pyr)s
�z ExecutableNotFoundError.__init__)�__name__�
__module__�__qualname__r�
__classcell__rrrrr(srcCst��dkr	t�St�S)zZ
    Return the appropriate HelpRenderer implementation for the
    current platform.
    �Windows)�platform�system�WindowsHelpRenderer�PosixHelpRendererrrrr�get_renderer.sr$c@sJeZdZdZejfdd�ZdZdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)�PagingHelpRendererz�
    Interface for a help renderer.

    The renderer is responsible for displaying the help content on
    a particular platform.

    cCs
||_dS�N)�
output_stream)rr'rrrrAs
zPagingHelpRenderer.__init__NcCs:|j}dtjvrtjd}n
dtjvrtjd}t�|�S)N�MANPAGER�PAGER)r)�os�environ�shlex�split)r�pagerrrr�get_pager_cmdlineFs



z$PagingHelpRenderer.get_pager_cmdlinecCs|�|�}|�|�dS)z`
        Each implementation of HelpRenderer must implement this
        render method.
        N)�_convert_doc_content�_send_output_to_pager)r�contents�converted_contentrrr�renderNs
zPagingHelpRenderer.rendercCs2|��}t�d|�|j|td�}|j|d�dS)N�Running command: %s��stdin��input)r/�LOG�debug�_popenr�communicate�r�output�cmdline�prrrr1Vsz(PagingHelpRenderer._send_output_to_pagercOst|i|��Sr&�r�r�args�kwargsrrrr<\szPagingHelpRenderer._popencCs|Sr&r)rr2rrrr0_sz'PagingHelpRenderer._convert_doc_content)
rrr�__doc__�sys�stdoutrr)r/r4r1r<r0rrrrr%9sr%c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
r#z[
    Render help content on a Posix-like system.  This includes
    Linux and MacOS X.
    zless -RcCs\t|t��d�}|�d�std��gd�}t�d|�|j|tttd�}|j	|d�d}|S)N��writer�groff)rKz-m�manz-T�asciir5)r7rH�stderrr8r)
rr�Writer�_exists_on_pathrr:r;r<rr=)rr2�man_contentsr@�p3�groff_outputrrrr0ks
z&PosixHelpRenderer._convert_doc_contentcCs�|��}|�|d�s&t�d|d�|j�|�d�d�|j��dSt�d|�t��|j	|t
d�}|j|d�Wd�dS1sHwYdS)Nrz0Pager '%s' not found in PATH, printing raw help.zutf-8�
r5r6r8)r/rPr:r;r'�write�decode�flushrr<rr=r>rrrr1us�
"�z'PosixHelpRenderer._send_output_to_pagercs(t�fdd�tj�dd��tj�D��S)Ncs"g|]
}tj�tj�|����qSr)r*�path�exists�join)�.0rA��namerr�
<listcomp>�s�z5PosixHelpRenderer._exists_on_path.<locals>.<listcomp>�PATH�)�anyr*r+�getr-�pathsep)rr]rr\rrP�s�z!PosixHelpRenderer._exists_on_pathN)rrrrFr)r0r1rPrrrrr#cs
r#c@s$eZdZdZdZdd�Zdd�ZdS)r"z*Render help content on a Windows platform.�morecCst|t�d�}|S)NrI)rr
)rr2�text_outputrrrr0�s�z(WindowsHelpRenderer._convert_doc_contentcOsd|d<t|i|��S)NT�shellrBrCrrrr<�szWindowsHelpRenderer._popenN)rrrrFr)r0r<rrrrr"�s
r"c@sVeZdZdZdZ	dd�Zedd��Zedd��Zed	d
��Z	edd��Z
d
d�ZdS)�HelpCommandak
    HelpCommand Interface
    ---------------------
    A HelpCommand object acts as the interface between objects in the
    CLI (e.g. Providers, Services, Operations, etc.) and the documentation
    system (bcdoc).

    A HelpCommand object wraps the object from the CLI space and provides
    a consistent interface to critical information needed by the
    documentation pipeline such as the object's name, description, etc.

    The HelpCommand object is passed to the component of the
    documentation pipeline that fires documentation events.  It is
    then passed on to each document event handler that has registered
    for the events.

    All HelpCommand objects contain the following attributes:

        + ``session`` - A ``botocore`` ``Session`` object.
        + ``obj`` - The object that is being documented.
        + ``command_table`` - A dict mapping command names to
              callable objects.
        + ``arg_table`` - A dict mapping argument names to callable objects.
        + ``doc`` - A ``Document`` object that is used to collect the
              generated documentation.

    In addition, please note the `properties` defined below which are
    required to allow the object to be used in the document pipeline.

    Implementations of HelpCommand are provided here for Provider,
    Service and Operation objects.  Other implementations for other
    types of objects might be needed for customization in plugins.
    As long as the implementations conform to this basic interface
    it should be possible to pass them to the documentation system
    and generate interactive and static help files.
    NcCsT||_||_|duri}||_|duri}||_i|_g|_t�|_tdd�|_	dS)NrL)�target)
�session�obj�
command_table�	arg_table�_subcommand_table�_related_itemsr$�rendererr�doc)rrirjrkrlrrrr�szHelpCommand.__init__cC�dS)aX
        Return the ``event_class`` for this object.

        The ``event_class`` is used by the documentation pipeline
        when generating documentation events.  For the event below::

            doc-title.<event_class>.<name>

        The document pipeline would use this property to determine
        the ``event_class`` value.
        Nr�rrrr�event_class�s
zHelpCommand.event_classcCrq)z�
        Return the name of the wrapped object.

        This would be called by the document pipeline to determine
        the ``name`` to be inserted into the event, as shown above.
        Nrrrrrrr]�szHelpCommand.namecC�|jS)z=These are the commands that may follow after the help command)rmrrrrr�subcommand_table��zHelpCommand.subcommand_tablecCrt)z:This is list of items that are related to the help command)rnrrrrr�
related_items�rvzHelpCommand.related_itemscCsv|r ti|j�}|�|�\}}t|dd�dur |j|j||�S|�|�}t�|j|�|j	�
|j���|�
�dS)N�
subcommand)rru�parse_known_args�getattrrx�EventHandlerClassr�generate_eventsriror4rp�getvalue�
unregister)rrD�parsed_globals�subcommand_parser�parsed�	remaining�instancerrr�__call__s�
zHelpCommand.__call__)rrrrFr{r�propertyrsr]rurwr�rrrrrg�s%

	

rgc@sHeZdZdZeZdd�Zedd��Zedd��Z	edd	��Z
d
d�ZdS)
�ProviderHelpCommandz^Implements top level help command.

    This is what is called when ``aws help`` is run.

    cCs<t�||d||�||_||_||_d|_d|_dg|_dS)Nzaws help topics)rgr�description�synopsis�
help_usagerm�
_topic_tag_dbrn)rrirkrlr�r��usagerrrrs
�zProviderHelpCommand.__init__cCrq�N�awsrrrrrrrs'�zProviderHelpCommand.event_classcCrqr�rrrrrrr]+r�zProviderHelpCommand.namecCs6|jdur|jdurt�|_|j��|��|_|jSr&)rmr�r�load_json_index�_create_subcommand_tablerrrrrru/s



z$ProviderHelpCommand.subcommand_tablecCsBi}t|j�}||d<|j��}|D]}t|j|�}|||<q|S�N�topics)�TopicListerCommandrir��get_all_topic_names�TopicHelpCommand)rru�topic_lister_command�topic_names�
topic_name�topic_help_commandrrrr�8s


z,ProviderHelpCommand._create_subcommand_tableN)rrrrFrr{rr�rsr]rur�rrrrr�s


r�cs<eZdZdZeZ�fdd�Zedd��Zedd��Z	�Z
S)�ServiceHelpCommandz�Implements service level help.

    This is the object invoked whenever a service command
    help is implemented, e.g. ``aws ec2 help``.

    cs&tt|��||||�||_||_dSr&)rr�r�_name�_event_class)rrirjrkrlr]rsrrrrPs
�
zServiceHelpCommand.__init__cCrtr&�r�rrrrrrsW�zServiceHelpCommand.event_classcCrtr&�r�rrrrrr][r�zServiceHelpCommand.name)rrrrFrr{rr�rsr]rrrrrr�Fs
r�c@s4eZdZdZeZdd�Zedd��Zedd��Z	dS)	�OperationHelpCommandz�Implements operation level help.

    This is the object invoked whenever help for a service is requested,
    e.g. ``aws ec2 describe-instances help``.

    cCs*t�|||d|�t�|_||_||_dSr&)rgrr�param_shorthandr�r�)rri�operation_modelrlr]rsrrrris
zOperationHelpCommand.__init__cCrtr&r�rrrrrrspr�z OperationHelpCommand.event_classcCrtr&r�rrrrrr]tr�zOperationHelpCommand.nameN)
rrrrFrr{rr�rsr]rrrrr�`s
r�c�8eZdZeZ�fdd�Zedd��Zedd��Z�Z	S)r�cstt|��|dii�dSr&)rr�r)rrirrrr|szTopicListerCommand.__init__cCrqr�rrrrrrrsr�zTopicListerCommand.event_classcCrqr�rrrrrrr]�r�zTopicListerCommand.name)
rrrr	r{rr�rsr]rrrrrr�ys
r�cr�)r�cs tt|��|dii�||_dSr&)rr�r�_topic_name)rrir�rrrr�s
zTopicHelpCommand.__init__cCs
d|jS)Nztopics.r\rrrrrrs�s
zTopicHelpCommand.event_classcCrtr&)r�rrrrrr]�r�zTopicHelpCommand.name)
rrrr
r{rr�rsr]rrrrrr��s
r�)/�loggingr*rGr r,�
subprocessrr�
docutils.corer�docutils.writersr�awscli.clidocsrrrr	r
�awscli.bcdocr�awscli.bcdoc.restdocr�awscli.bcdoc.textwriterr
�awscli.argprocessr�awscli.argparserr�awscli.topictagsr�awscli.utilsr�	getLoggerr:�	Exceptionrr$�objectr%r#r"rgr�r�r�r�r�rrrr�<module>s@
*1o2

https://t.me/RX1948 - 2025