403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/prompt_toolkit/completion/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/prompt_toolkit/completion/__pycache__/nested.cpython-311.pyc
�

�Ïc���dZddlmZmZmZmZmZmZmZddl	m
Z
mZmZddl
mZddlmZdgZeeeeeedeffZGd�de��ZdS)	zA
Nestedcompleter for completion of hierarchical data structures.
�)�Any�Dict�Iterable�Mapping�Optional�Set�Union)�
CompleteEvent�	Completer�
Completion)�
WordCompleter)�Document�NestedCompleterNc��eZdZdZ	ddeeeefdeddfd�Z	defd�Z
ed	eddfd
���Z
dededeefd
�ZdS)ra�
    Completer which wraps around several other completers, and calls any the
    one that corresponds with the first word of the input.

    By combining multiple `NestedCompleter` instances, we can achieve multiple
    hierarchical levels of autocompletion. This is useful when `WordCompleter`
    is not sufficient.

    If you need multiple levels, check out the `from_nested_dict` classmethod.
    T�options�ignore_case�returnNc�"�||_||_dS�N�rr)�selfrrs   �B/usr/lib/python3/dist-packages/prompt_toolkit/completion/nested.py�__init__zNestedCompleter.__init__s�����&�����c�(�d|j�d|j�d�S)NzNestedCompleter(z, ignore_case=�)r)rs r�__repr__zNestedCompleter.__repr__#s ��U�$�,�U�U��@P�U�U�U�Ur�datac�d�i}|���D]�\}}t|t��r|||<� t|t��r|�|��||<�Nt|t
��r#|�d�|D����||<��|�J�d||<��||��S)a�
        Create a `NestedCompleter`, starting from a nested dictionary data
        structure, like this:

        .. code::

            data = {
                'show': {
                    'version': None,
                    'interfaces': None,
                    'clock': None,
                    'ip': {'interface': {'brief'}}
                },
                'exit': None
                'enable': None
            }

        The value should be `None` if there is no further completion at some
        point. If all values in the dictionary are None, it is also possible to
        use a set instead.

        Values in this data structure can be a completers as well.
        c��i|]}|d��Sr�)�.0�items  r�
<dictcomp>z4NestedCompleter.from_nested_dict.<locals>.<dictcomp>Fs��4R�4R�4R�D�T�4�4R�4R�4RrN)�items�
isinstancer�dict�from_nested_dict�set)�clsrr�key�values     rr(z NestedCompleter.from_nested_dict&s���235���*�*�,�,�		$�		$�J�C���%��+�+�
$�$������E�4�(�(�
$�"�3�3�E�:�:������E�3�'�'�
$�"�3�3�4R�4R�E�4R�4R�4R�S�S������}�}�}�#������s�7�|�|�r�document�complete_eventc#�K�|j���}t|j��t|��z
}d|vr�|���d}|j�|��}|��|t|��d����}t|��t|��z
|z}t
||j|z
���}	|�|	|��Ed{V��dSdStt|j�����|j���}|�||��Ed{V��dS)N� r)�cursor_position)r)
�text_before_cursor�lstrip�len�splitr�getrr1�get_completionsr
�list�keysr)
rr-r.�text�stripped_len�
first_term�	completer�remaining_text�move_cursor�new_documents
          rr7zNestedCompleter.get_completionsMsm�����*�1�1�3�3���8�6�7�7�#�d�)�)�C���$�;�;������a��J���(�(��4�4�I��$�!%�c�*�o�o�&7�&7�!8�!?�!?�!A�!A��!�$�i�i�#�n�*=�*=�=��L��'�"�$,�$<�{�$J� � � ��
%�4�4�\�>�R�R�R�R�R�R�R�R�R�R�R�%�$�&��T�\�&�&�(�(�)�)�t�7G����I�!�0�0��>�J�J�J�J�J�J�J�J�J�J�Jr)T)�__name__�
__module__�__qualname__�__doc__r�strrr�boolrr�classmethod�
NestedDictr(rr
rrr7r!rrrrs�������	�	�LP�'�'��C��)�!4�4�5�'�DH�'�	
�'�'�'�'�V�#�V�V�V�V��$�J�$�3D�$�$�$��[�$�LK� �K�2?�K�	�*�	�K�K�K�K�K�Kr)rD�typingrrrrrrr	�prompt_toolkit.completionr
rr�(prompt_toolkit.completion.word_completerr
�prompt_toolkit.documentr�__all__rErHrr!rr�<module>rNs�����F�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�J�J�J�J�J�J�J�J�J�J�B�B�B�B�B�B�,�,�,�,�,�,��
���S�%��S��X�t�Y� >�?�?�
@�
�[K�[K�[K�[K�[K�i�[K�[K�[K�[K�[Kr

Youez - 2016 - github.com/yon3zu
LinuXploit