Your IP : 3.137.175.83


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/AutoComplete.cpython-35.opt-2.pyc



���]�#�@s�ddlZddlZddlZddlmZejejdZedd�\Z	Z
ddlmZddl
mZddlZejZejr�eej7ZGdd	�d	�Zed
kr�ddlmZedd
d�dS)�N)�idleConf�_��)�AutoCompleteWindow)�HyperParserc@s�eZdZdd!gfgZejddddddd	�Zd
dd�Zd
d�Zd
dd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
dd�Zdd�Zdd �Zd
S)"�AutoCompleteZedit�Show Completions�<<force-open-completions>>�
extensions�	popupwait�type�int�defaultrNcCsD||_|dkrdS|j|_d|_d|_d|_dS)N)�editwin�text�autocompletewindow�_delayed_completion_id�_delayed_completion_index)�selfr�r�1/opt/alt/python35/lib64/python3.5/AutoComplete.py�__init__&s			zAutoComplete.__init__cCstj|j�S)N)rr)rrrr�_make_autocomplete_window3sz&AutoComplete._make_autocomplete_windowcCs#|jr|jj�d|_dS)N)rZhide_window)r�eventrrr�_remove_autocomplete_window6s	
z(AutoComplete._remove_autocomplete_windowcCs|jddd�dS)NTF)�open_completions)rrrrr�force_open_completions_event;sz)AutoComplete.force_open_completions_eventcCs]|jjd�}|dkr7|jdddt�n"|tkrY|jdddt�dS)Nz	insert-1c�.F)r�get�_open_completions_later�COMPLETE_ATTRIBUTES�SEPS�COMPLETE_FILES)rrZlastcharrrr�try_open_completions_eventAs
z'AutoComplete.try_open_completions_eventcCsht|d�r|jrdS|jrE|jj�rE|jj�dS|jddd�}|rddSdS)N�mc_state�breakFT)�hasattrr%rZ	is_active�completer)rrZopenedrrr�autocomplete_eventNs
zAutoComplete.autocomplete_eventcGs\|jjd�|_|jdk	r7|jj|j�|jj|j|j|�|_dS)N�insert)r�indexrr�after_cancel�afterr�_delayed_open_completions)r�argsrrrr ^s
z$AutoComplete._open_completions_latercGs9d|_|jjd�|jkr(dS|j|�dS)Nr*)rrr+rr)rr/rrrr.fs	z&AutoComplete._delayed_open_completionscCs�|jdk	r+|jj|j�d|_t|jd�}|jjdd�}t|�}}|j�r|s�|tkr|j	�t}x,|r�||ddt
kr�|d8}q�W|||�}	|}x(|r||ddkr|d8}q�W|||�}
n|j�r|s3|tkr|j	�t}xB|r�||dt
kszt||d�dkr�|d8}qFW|||�}	|r||ddkr|jdt|�|d�|j�}
|
s|r
|
jd�dkr
dSqd	}
ndS|r,|
r,|	r,dS|j|
|�}|d
sLdS|j�|_|jj|dt|	�|||�S)Nr*zinsert linestartrz'"�rz
insert-%dc�(�r���)rrr,rrr�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_listsrrrrlsN	
!
7	
	zAutoComplete.open_completionsc	Cs�y|jjjjj}Wnd}YnX|rL|jdd||fi�S|tkrK|dkr�tjj	�}|j
tjj�td|�}|j
�d|kr�ttd|��}qHdd�|D�}q�yZ|j|�}t|�}|j
�d|krt|j�}ndd�|D�}Wq�ggfSYq�Xn|tkr�|dkrid	}yBtjj|�}tj|�}|j
�d
d�|D�}Wntk
r�ggfSYnX|s�|}||fSdS)N�execZget_the_completion_listr2zdir()�__all__cSs,g|]"}|dd�dkr|�qS)Nrrr)�.0�srrr�
<listcomp>�s	z2AutoComplete.fetch_completions.<locals>.<listcomp>cSs,g|]"}|dd�dkr|�qS)Nrrr)r>r?rrrr@�s	rcSs,g|]"}|dd�dkr|�qS)Nrrr)r>r?rrrr@�s	)r�flistZpyshellZinterp�rpccltZ
remotecallr!�__main__�__dict__�copy�update�__builtins__�eval�sort�sorted�
get_entity�dirr=r#�os�path�
expanduser�listdir�OSError)	rZwhatr9rB�	namespaceZbiglZsmalllZentityZexpandedpathrrrr8�sL



zAutoComplete.fetch_completionscCs,tjj�}|jtj�t||�S)N)�sys�modulesrErFrCrDrH)r�namerRrrrrK�szAutoComplete.get_entity)r	r
)�__name__�
__module__�__qualname__ZmenudefsrZ	GetOptionrrrrrr$r)r r.rr8rKrrrrrs

;9rrC)�mainz#idlelib.idle_test.test_autocomplete�	verbosity�)rMrS�stringZidlelib.configHandlerr�
ascii_letters�digitsr5�ranger!r#ZidlelibrZidlelib.HyperParserrrC�sepr"�altseprrVZunittestrYrrrr�<module>s		
�

?>