Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/__pycache__/rlcompleter.cpython-311.opt-1.pyc
�

�,d�����dZddlZddlZddlZddlZddlZddlZdgZGd�d��Zd�Z		ddl
Z
e
je��j��ej
d���dZdS#e$rdZYdSwxYw)	a1Word completion for GNU readline.

The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.

It's very cool to do "import sys" type "sys.", hit the completion key (twice),
and see the list of names defined by the sys module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")

Notes:

- Exceptions raised by the completer function are *ignored* (and generally cause
  the completion to fail).  This is a feature -- since readline sets the tty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without some complicated hoopla to save, reset and restore the tty state.

- The evaluation of the NAME.NAME... form may cause arbitrary application
  defined code to be executed if an object with a __getattr__ hook is found.
  Since it is the responsibility of the application (or the user) to enable this
  feature, I consider this an acceptable risk.  More complicated expressions
  (e.g. function calls or indexing operations) are *not* evaluated.

- When the original stdin is not a tty device, GNU readline is never
  used, and this module (and the readline module) are silently inactive.

�N�	Completerc�.�eZdZdd�Zd�Zd�Zd�Zd�ZdS)rNc��|r$t|t��std���|�	d|_dSd|_||_dS)a�Create a new completer for the command line.

        Completer([namespace]) -> completer instance.

        If unspecified, the default namespace where completions are performed
        is __main__ (technically, __main__.__dict__). Namespaces should be
        given as dictionaries.

        Completer instances should be used as the completion mechanism of
        readline via the set_completer() call:

        readline.set_completer(Completer(my_namespace).complete)
        znamespace must be a dictionaryN�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfrs  �2/opt/alt/python311/lib64/python3.11/rlcompleter.py�__init__zCompleter.__init__*sU���	>�Z�	�4�8�8�	>��<�=�=�=�
�� �D���� �D��&�D�N�N�N�c��|jrtj|_|���s:|dkr2t
r)t
jd��t
j��dSdSdS|dkr9d|vr|�	|��|_
n|�|��|_
	|j
|S#t$rYdSwxYw)z�Return the next possible completion for 'text'.

        This is called successively with state == 0, 1, 2, ... until it
        returns None.  The completion should begin with 'text'.

        r�	�N�.)
r
�__main__�__dict__r�strip�_readline_available�readline�insert_text�	redisplay�attr_matches�matches�global_matches�
IndexError)r�text�states   r
�completezCompleter.completeEs�����	/�%�.�D�N��z�z�|�|�		���z�z�&� ��(��.�.�.��&�(�(�(��2��4��t��A�:�:��d�{�{�#�0�0��6�6����#�2�2�4�8�8���	��<��&�&���	�	�	��4�4�	���s�'B4�4
C�Cc��t|��r5|dz
}	tj|��js|dz
}n#t$rYnwxYw|S)N�(�))�callable�inspect�	signature�
parameters�
ValueError)r�val�words   r
�_callable_postfixzCompleter._callable_postfixdse���C�=�=�	��C�K�D�
��(��-�-�8� ��C�K�D����
�
�
���
�����s�5�
A�Ac��g}dh}t|��}tjtjzD]M}|d|�|kr=|�|��|dvr|dz}n	|dvr|dz}|�|���N|jtjfD]l}|�	��D]U\}}|d|�|krB||vr>|�|��|�|�
||�����V�m|S)z�Compute matches when text is a simple name.

        Return a list of all keywords, built-in functions and names currently
        defined in self.namespace that match.

        �__builtins__N>�try�finally�:>�_�None�True�else�pass�False�break�continue� )�len�keyword�kwlist�
softkwlist�add�appendr�builtinsr�itemsr,)rrr�seen�nr+�nspacer*s        r
rzCompleter.global_matchesos2���������I�I���N�W�%7�7�		%�		%�D��B�Q�B�x�4�����������-�-�-��#�:�D�D��"/�/�/� �#�:�D����t�$�$�$���~�x�'8�9�	F�	F�F�#�\�\�^�^�
F�
F�	��c�����8�t�#�#��D�(8�(8��H�H�T�N�N�N��N�N�4�#9�#9�#�t�#D�#D�E�E�E��
F��rc���tjd|��}|sgS|�dd��\}}	t||j��}n#t
$rgcYSwxYwt
t|����}|�d��t|d��r<|�
d��|�t|j
����g}t|��}|dkrd}	n|dkrd}	nd	}		|D]�}
|
d	|�|kr�|	r|
d	|dz�|	ks�|�d|
��}tt!t#|��|
d	��t$��r|�|���qt!||
d	��x}�*|�|�||������|�|����|s|	sn|	dkrd}	nd	}	��|���|S)a�Compute matches when text contains a dot.

        Assuming the text is of the form NAME.NAME....[NAME], and is
        evaluable in self.namespace, it will be evaluated and its attributes
        (as revealed by dir()) are used as possible completions.  (For class
        instances, class members are also considered.)

        WARNING: this can still invoke arbitrary C code, if an object
        with a __getattr__ hook is evaluated.

        z(\w+(\.\w+)*)\.(\w*)r�r.�	__class__rr2�__NTr)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr?�update�get_class_membersrHr;r�getattr�type�propertyr@r,�sort)
rr�m�expr�attr�
thisobject�wordsrrD�noprefixr+rK�values
             r
rzCompleter.attr_matches�s:��
�H�,�d�3�3���	��I��W�W�Q��]�]�
��d�	��d�D�N�3�3�J�J���	�	�	��I�I�I�	�����C�
�O�O�$�$��
�
�
�n�%�%�%��:�{�+�+�	B��I�I�k�"�"�"��L�L�*�:�+?�@�@�A�A�A�����I�I���2�:�:��H�H�
�S�[�[��H�H��H�	 ��
.�
.����!��H��$�$�!�%�&*�4�A�a�C�4�j�H�&<�&<�'+�t�t�T�T�2�E�!�'�$�z�*:�*:�D�$�"G�"G�"*�,�,�	!� ���u�-�-�-� �!(��T�4�!@�!@�@��M����t�'=�'=�e�U�'K�'K�L�L�L�L����u�-�-�-���
�h�
���3��������1	 �2	�������s�A
�
A�A�N)�__name__�
__module__�__qualname__rr!r,rr�rr
rr)sd������'�'�'�'�6���>	�	�	����6>�>�>�>�>rc�|�t|��}t|d��r|jD]}|t|��z}�|S)N�	__bases__)rPrRrfrT)�klass�ret�bases   r
rTrT�sJ��

�e�*�*�C��u�[�!�!�0��O�	0�	0�D��)�$�/�/�/�C�C��Jrc�*�tjd��Sr`)r�
set_completerrdrr
�<lambda>rl�s��H�2�4�8�8�rTF)�__doc__�atexitrAr&r<rJr�__all__rrTrrkr!�registerr�ImportErrorrdrr
�<module>rrs
����>�
�
�
�������������	�	�	�	������-��_�_�_�_�_�_�_�_�B���
��O�O�O��H��9�9�;�;�/�0�0�0��F�O�8�8�9�9�9������� � � ������ ���s�A%�%A0�/A0

ZeroDay Forums Mini