Your IP : 3.142.131.51


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/autocomplete.cpython-36.opt-2.pyc

3

��2al$�@s�ddlZddlZddlZedd�\ZZddlmZddlm	Z	ddl
mZddlZej
ejdZejZejrxeej7ZGdd	�d	�Zej�ed
kr�ddlmZeddd
�dS)�N��)�autocomplete_w)�idleConf)�HyperParser�_c@sveZdZddd�Zedd��Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dd�Zdd�ZdS)�AutoCompleteNcCs,||_|dk	r(|j|_d|_d|_d|_dS)N)�editwin�text�autocompletewindow�_delayed_completion_id�_delayed_completion_index)�selfr	�r�1/opt/alt/python36/lib64/python3.6/autocomplete.py�__init__szAutoComplete.__init__cCstjdddddd�|_dS)N�
extensionsr�	popupwait�intr)�type�default)rZ	GetOptionr)�clsrrr�reload)szAutoComplete.reloadcCstj|j�S)N)rZAutoCompleteWindowr
)rrrr�_make_autocomplete_window.sz&AutoComplete._make_autocomplete_windowcCs|jr|jj�d|_dS)N)rZhide_window)r�eventrrr�_remove_autocomplete_window1s
z(AutoComplete._remove_autocomplete_windowcCs|jddd�dS)NTF�break)�open_completions)rrrrr�force_open_completions_event6sz)AutoComplete.force_open_completions_eventcCsB|jjd�}|dkr&|jdddt�n|tkr>|jdddt�dS)Nz	insert-1c�.F)r
�get�_open_completions_later�COMPLETE_ATTRIBUTES�SEPS�COMPLETE_FILES)rrZlastcharrrr�try_open_completions_event=s

z'AutoComplete.try_open_completions_eventcCsdt|d�r|js$|jjdd�j�r(dS|jrF|jj�rF|jj�dS|jddd�}|r\dSdSdS)N�mc_statezinsert linestart�insertrFT)	�hasattrr&r
r �striprZ	is_active�completer)rrZopenedrrr�autocomplete_eventJs
zAutoComplete.autocomplete_eventcGsD|jjd�|_|jdk	r&|jj|j�|jj|j|jf|��|_dS)Nr')r
�indexr
r�after_cancel�afterr�_delayed_open_completions)r�argsrrrr![s

z$AutoComplete._open_completions_latercGs&d|_|jjd�|jkr"|j|�dS)Nr')rr
r,r
r)rr0rrrr/csz&AutoComplete._delayed_open_completionscCs�|jdk	r|jj|j�d|_t|jd�}|jjdd�}t|�}}|j�r�|sZ|tkr�|j	�t}x$|r�||ddt
kr�|d8}qhW|||�}	|}x |r�||ddkr�|d8}q�W|||�}
n�|j�o�|s�|tk�r�|j	�t}x:|�r*||dt
k�s t||d�dk�r*|d8}q�W|||�}	|�r�||ddk�r�|jdt|�|d�|j�}
|
�s�|�r�|
jd�dk�r�dSnd	}
ndS|�r�|
�r�|	�r�dS|j|
|�}|d
�s�dS|j�|_|jj|dt|	�|||�S)Nr'zinsert linestartrz'"�rz
insert-%dc�(�r���)rr
r-rr	r �lenZis_in_stringr$rr#Z
is_in_coder"�ID_CHARS�ordZ	set_indexZget_expression�find�fetch_completionsrrZshow_window)rZ	evalfuncsr*ZuserWantsWin�modeZhpZcurline�i�jZ
comp_startZ	comp_whatZ
comp_listsrrrrhsN
0

zAutoComplete.open_completionsc	Csjy|jjjjj}Wnd}YnX|r<|jdd||fi�S|tkr�|dkr�tjj	�}|j
tjj�td|�}|j
�d|kr�ttd|��}q�dd�|D�}nPy@|j|�}t|�}|j
�d|kr�t|j�}ndd�|D�}WnggfSnd|tk�rT|dk�rd	}y0tjj|�}tj|�}|j
�d
d�|D�}Wntk
�rRggfSX|�s^|}||fSdS)N�execZget_the_completion_listr3zdir()�__all__cSs g|]}|dd�dkr|�qS)Nrrr)�.0�srrr�
<listcomp>�sz2AutoComplete.fetch_completions.<locals>.<listcomp>cSs g|]}|dd�dkr|�qS)Nrrr)r?r@rrrrA�srcSs g|]}|dd�dkr|�qS)Nrrr)r?r@rrrrA�s)r	�flistZpyshellZinterp�rpccltZ
remotecallr"�__main__�__dict__�copy�update�__builtins__�eval�sort�sorted�
get_entity�dirr>r$�os�path�
expanduser�listdir�OSError)	rZwhatr:rC�	namespaceZbiglZsmalllZentityZexpandedpathrrrr9�sL








zAutoComplete.fetch_completionscCs tjj�}|jtj�t||�S)N)�sys�modulesrFrGrDrErI)r�namerSrrrrL�s
zAutoComplete.get_entity)N)N)N)�__name__�
__module__�__qualname__r�classmethodrrrrr%r+r!r/rr9rLrrrrrs



;9rrD)�mainz#idlelib.idle_test.test_autocomplete)�	verbosity�)rN�stringrT�ranger"r$ZidlelibrZidlelib.configrZidlelib.hyperparserrrDZ
ascii_letters�digitsr6�sepr#�altseprrrWZunittestr[rrrr�<module>s"
H

?>