Sindbad~EG File Manager
�
%Μg�$���dZddlZddlZddlZddlZddlZejD�cgc]}|dvr|��
c}Zejd�ej�d\Z
Zddlm
Z
ddlmZddlmZd Zd
Zddde
fZdddefZej,ej.zdzZej2�ej4rej4nd
��Zde��ZGd�d�Zej=�edk(rddl m!Z!e!dd��yycc}w)z�Complete either attribute names or file names.
Either on demand or after a user-selected delay after a key character,
pop up a list of candidates.
�N>�None�True�False)�match�case)r�)�autocomplete_w)�idleConf)�HyperParser)TFTN)FTTNF�_��.c�^�eZdZd
d�Zed��Zd�Zdd�Zd�Zd�Z dd�Z
d �Zd
�Zd�Z
d�Zy)�AutoCompleteNc�p�||_|�|j|_||_d|_d|_d|_y�N)�editwin�text�tags�autocompletewindow�_delayed_completion_id�_delayed_completion_index)�selfrrs �1/usr/local/lib/python3.12/idlelib/autocomplete.py�__init__zAutoComplete.__init__(s;����������D�I��� �"&���'+��#�)-��&�c�B�tjddddd��|_y)N�
extensionsr� popupwait�intr)�type�default)r
� GetOptionr)�clss r�reloadzAutoComplete.reload4s �� �*�*��.�+�E�1�N��
rc�X�tj|j|j��S)N)r)r �AutoCompleteWindowrr)rs r�_make_autocomplete_windowz&AutoComplete._make_autocomplete_window9s���0�0�������K�Krc�`�|jr"|jj�d|_yyr)r�hide_window�r�events r�_remove_autocomplete_windowz(AutoComplete._remove_autocomplete_window<s*���"�"��#�#�/�/�1�&*�D�#�#rc�.�|jt�y)zA(^space) Open completion list, even if a function call is needed.�break)�open_completions�FORCEr+s r�force_open_completions_eventz)AutoComplete.force_open_completions_eventAs�����e�$�rc�@�t|d�r|js*|jjdd�j �sy|j
r5|j
j
�r|j
j�y|jt�}|rdSdS)z5(tab) Complete word or open list if multiple options.�mc_state�insert linestart�insertNr/)
�hasattrr4r�get�stripr� is_active�completer0�TAB)rr,�openeds r�autocomplete_eventzAutoComplete.autocomplete_eventFs���5�*�%�%�.�.��I�I�M�M�"4�h�?�E�E�G���"�"�t�'>�'>�'H�'H�'J��#�#�,�,�.���*�*�3�/�F�$�7�.�$�.rc�|�|jjd�}|tvr�|dk(rtnt}|jjd�|_|j�%|jj|j�|jj|j|j|�|_yy)z7(./) Open completion list after pause with no movement.z insert-1crr6N)rr8�TRIGGERS�TRY_A�TRY_F�indexrr�after_cancel�afterr�_delayed_open_completions)rr,�lastchar�argss r�try_open_completions_eventz'AutoComplete.try_open_completions_eventTs����9�9�=�=��-���x��$��O�5��D�-1�Y�Y�_�_�X�-F�D�*��*�*�6�� � �&�&�t�'B�'B�C�*.�)�)�/�/����� >� >��+F�D�'� rc��d|_|jjd�|jk(r|j |�yy)z)Call open_completions if index unchanged.Nr6)rrrCrr0)rrHs rrFz&AutoComplete._delayed_open_completions_s9��&*��#��9�9�?�?�8�$��(F�(F�F��!�!�$�'�Grc��|\}}}}|j�,|jj|j�d|_t|jd�}|jjdd�}t
|�x}} |j�rx|r |tk(rm|j�t}|r*||dz
dtzvr|dz}|r||dz
dtzvr�||| }
|} |r||dz
dvr|dz}|r||dz
dvr�||| }n�|j�r�|r |tk(r�|j�t}|rM||dz
tvst||dz
�dkDr+|dz}|r$||dz
tvr�t||dz
�dkDr�+||| }
|rW||dz
dk(rL|jdt
|�|dz
z
z�|j!�}|r|s|j#d �d
k7ryd}ny|r|s|
sy|j%||�}|dsy|j'�|_|j(j+|dt
|
�z|||�S)
aXFind the completions and create the AutoCompleteWindow.
Return True if successful (no syntax error or so found).
If complete is True, then if there's nothing to complete and no
start of completion, won't open completions and return False.
If mode is given, will open a completion list only in this mode.
Nr6r5rz'"�rz
insert-%dc�(���r
r)rrrDrrr8�len�is_in_string�FILESr-�SEPS�
is_in_code�ATTRS�ID_CHARS�ord� set_index�get_expression�find�fetch_completionsr(r�show_window)
rrH� evalfuncsr;�wantwin�mode�hp�curline�i�j�
comp_start� comp_what�
comp_listss
rr0zAutoComplete.open_completionsesd��.2�*� �8�W�d��&�&�2��I�I�"�"�4�#>�#>�?�*.�D�'�
����x�
0���)�)�-�-� 2�H�=���G����A�
�?�?��d�d�E�k�
�,�,�.��D����!���E�D�L�8��Q������!���E�D�L�8� ��1��J��A����!���E�1��Q������!���E�1���!��I�
�]�]�_�d�d�E�k��,�,�.��D����1����1�S���1���5F��5L��Q������1����1�S���1���5F��5L� ��1��J��W�Q�q�S�\�S�(����\�S��\�1�Q�3�-?�@�A��-�-�/� �!�!�i�n�n�S�&9�R�&?��� ���I�j���+�+�I�t�<�
��!�}��"&�"@�"@�"B����*�*�6�6��L�3�z�?�:��$��)�)� )rc��� |jjjjj}|r|jdd||fi�S|tk(r�|dk(r�itjj�tj�}td|�}|jt�|j�d|vrttd|��}n�|D�cgc]
}|dddk7s�|��}}n� |j|�}t!|�}|j�d|vrt|j"�}n|D�cgc]
}|dddk7s�|��}}nm|t$k(rd|dk(rd } t&j(j+|�} t'j,| �}|j�|D�cgc]
}|ddd k7s�|��}}s}|fS#d}Y���xYwcc}wcc}w#ggfcYSxYwcc}w#t.$rggfcYSwxYw)
aOReturn a pair of lists of completions for something. The first list
is a sublist of the second. Both are sorted.
If there is a Python subprocess, get the comp. list there. Otherwise,
either fetch_completions() is running in the subprocess itself or it
was called in an IDLE EditorWindow before any script had been run.
The subprocess environment is that of the most recently run script. If
two unrelated modules are being edited some calltips in the current
module may be inoperative if the module was not the last to run.
N�exec�get_the_completion_listr
zdir()�__all__rrr)r�flist�pyshell�interp�rpcclt�
remotecallrT�__main__�__builtins__�__dict__�eval�extend�completion_kwds�sort�sorted�
get_entity�dirrirQ�os�path�
expanduser�listdir�OSError)
r�whatr^rm� namespace�bigl�smalll�s�entity�expandedpaths
rrZzAutoComplete.fetch_completions�s��� ��\�\�'�'�/�/�6�6�=�=�F���$�$�V�-F�&*�D�\�2�7�
7��u�}��2�:�!6�8�#8�#8�#A�#A�!6�#+�#4�#4�!6�I����3�D��K�K��0��I�I�K� �D�(�!'��Y� �(B�!C��-1�!B�T��Q�r��U�c�\�!�T��!B� &�!%����!6��"�6�{��� � ��$��,�%+�F�N�N�%;�F�15�%F��A��2�A��#��a��F�%F������2�:��D�"�#%�7�7�#5�#5�d�#;�L��:�:�l�3�D��I�I�K�)-�>��A��2�A��#��a��F�>�����4�<���U ��F��"C��&G��&�!�2�v�
��?���"��r�6�M�"�sg�4G�
G�%G�-A
G�7
G�G� G�AG%�%
G �3G �7G%�G�G�G� G%�%
G5�4G5c�Z�t|itj�tj��S)zBLookup name in a namespace spanning sys.modules and __main.dict__.)rr�sys�modulesrorq)r�names rrwzAutoComplete.get_entity�s$���D�>�S�[�[�>�H�,=�,=�>�?�?r)NNr)�__name__�
__module__�__qualname__r�classmethodr%r(r-r2r>rIrFr0rZrw�rrrr&sO��
.��N��N�L�+�
�
/� F�(�:)�x8 �t@rrro)�mainz#idlelib.idle_test.test_autocomplete�)� verbosity)"�__doc__ro�keywordry�stringr��kwlistrtrsrurTrQ�idlelibr �idlelib.configr
�idlelib.hyperparserrr1r<rArB�
ascii_letters�digitsrU�sep�altseprRr@rr%r��unittestr�)r�s0r�<module>r�s���
�� �
�
�&�n�n�<�n���!:�:��n�<�����(�)��������u�"�#�+� *��)��
�%�E�U�*��
�%�E�U�*�����&�-�-�/�#�5��
�&�&��r�y�y�"�)�)�b�1�2��
�t�f�:��w@�w@�t
�����z���� .�!�<���k<s�
C7
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists