AlkantarClanX12

Your IP : 18.119.161.216


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



���]:�@s�ddlmZddlmZddddddiZd	ZGd
d�d�Zedkr|dd
lZej	ddd�d
S)�)�HyperParser)�idleConf�)�(�]�[�}�{�dc@sBeZdZdd0gfgZejddddd�Zejdddd	d
dd�Zejej	�d�Z
ejddd
d	ddd�ZdZd1Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd!S)2�
ParenMatchZedit�Show surrounding parens�<<flash-paren>>�
extensions�style�default�
expressionzflash-delay�type�inti�Zhilite�bell�bool�z<<parenmatch-check-restore>>�
<KeyPress>�
<ButtonPress>�<Key-Return>�<Key-BackSpace>cCsT||_|j|_|jj|j|j�d|_d|_|j|j�dS)Nr)	�editwin�text�bind�RESTORE_VIRTUAL_EVENT_NAME�
restore_event�counter�is_restore_active�	set_style�STYLE)�selfr�r%�//opt/alt/python35/lib64/python3.5/ParenMatch.py�__init__;s	
		zParenMatch.__init__cCs@|js<x'|jD]}|jj|j|�qWd|_dS)NT)r!�RESTORE_SEQUENCESrZ	event_addr)r$�seqr%r%r&�activate_restoreGs	zParenMatch.activate_restorecCs@|jr<x'|jD]}|jj|j|�qWd|_dS)NF)r!r(rZevent_deleter)r$r)r%r%r&�deactivate_restoreMs	zParenMatch.deactivate_restorecCsX||_|dkr0|j|_|j|_n$|dkrT|j|_|j|_dS)Nrr)r#�create_tag_default�
create_tag�set_timeout_last�set_timeout�create_tag_expression�set_timeout_none)r$rr%r%r&r"Ss	zParenMatch.set_stylecCsWt|jd�j�}|dkr2|j�dS|j�|j|�|j�dS)N�insert)rr�get_surrounding_brackets�warn_mismatchedr*r-r.)r$�event�indicesr%r%r&�flash_paren_event\s


zParenMatch.flash_paren_eventcCs�|jjd�}|tkr"dSt|jd�}|j�sDdS|jt|d�}|dkrt|j�dS|j�|j	|�|j
�dS)Nz	insert-1cT)r�get�_openersrrZ
is_in_coder3r4r*r-r/)r$r5ZcloserZhpr6r%r%r&�paren_closed_eventfs


zParenMatch.paren_closed_eventNcCs-|jjd�|j�|jd7_dS)N�parenr)rZ
tag_deleter+r )r$r5r%r%r&rvs
zParenMatch.restore_eventcCs||jkr|j�dS)N)r r)r$Ztimer_countr%r%r&�handle_restore_timer{szParenMatch.handle_restore_timercCs|jr|jj�dS)N)�BELLrr)r$r%r%r&r4s	zParenMatch.warn_mismatchedcCs1|jjd|d�|jjd|j�dS)Nr;r)r�tag_add�
tag_config�
HILITE_CONFIG)r$r6r%r%r&r,�szParenMatch.create_tag_defaultcCsk|jj|d�dkr-|dd}n
|d}|jjd|d|�|jjd|j�dS)	Nrrrrz+1cr;r)rrr)rr8r>r?r@)r$r6Z
rightindexr%r%r&r0�s

z ParenMatch.create_tag_expressioncCsP|jd7_||j|jjd�dd�}|jjjt||�dS)Nrr2cSsE||jjd�kr(|j|�n|jjjt||�dS)Nr2)r�indexr<r�
text_frame�after�CHECK_DELAY)�callmer$�crAr%r%r&rE�sz+ParenMatch.set_timeout_none.<locals>.callme)r rrArrBrCrD)r$rEr%r%r&r1�s	zParenMatch.set_timeout_nonecCs;|jd7_|jjj|j||jdd��dS)NrcSs
|j|�S)N)r<)r$rFr%r%r&�<lambda>�sz-ParenMatch.set_timeout_last.<locals>.<lambda>)r rrBrC�FLASH_DELAY)r$r%r%r&r.�szParenMatch.set_timeout_last)rr
)rrrr)�__name__�
__module__�__qualname__ZmenudefsrZ	GetOptionr#rHZGetHighlightZCurrentThemer@r=rr(r'r*r+r"r7r:rr<r4r,r0r1r.r%r%r%r&rs2		
r�__main__Nz!idlelib.idle_test.test_parenmatch�	verbosity�)
Zidlelib.HyperParserrZidlelib.configHandlerrr9rDrrIZunittest�mainr%r%r%r&�<module>s�