Hacked By AnonymousFox

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

3

��2a$�@sbddlmZddlmZdddd�ZdZGdd	�d	�Zej�ed
kr^ddl	m
Z
e
dd
d�dS)�)�HyperParser)�idleConf�(�[�{)�)�]�}�dc@s�eZdZdZd$Zdd�Zedd	��Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zd%dd�Z
dd�Zdd�Zdd�Zdd�Zeeeed�Zd d!�Zd"d#�ZdS)&�
ParenMatchz<<parenmatch-check-restore>>�
<KeyPress>�
<ButtonPress>�<Key-Return>�<Key-BackSpace>cCs0||_|j|_|jj|j|j�d|_d|_dS)Nr)�editwin�textZbind�RESTORE_VIRTUAL_EVENT_NAME�
restore_event�counter�is_restore_active)�selfr�r�//opt/alt/python36/lib64/python3.6/parenmatch.py�__init__(s
zParenMatch.__init__cCsVtjddddd�|_tjdddddd	�|_tjddd
ddd	�|_tjtj�d
�|_dS)N�
extensionsrZstyle�opener)�defaultzflash-delay�inti�)�typer�bell�bool�Zhilite)rZ	GetOption�STYLE�FLASH_DELAY�BELLZGetHighlightZCurrentTheme�
HILITE_CONFIG)�clsrrr�reload3s
zParenMatch.reloadcCs0|js,x|jD]}|jj|j|�qWd|_dS)NT)r�RESTORE_SEQUENCESrZ	event_addr)r�seqrrr�activate_restore>szParenMatch.activate_restorecCs0|jr,x|jD]}|jj|j|�qWd|_dS)NF)rr(rZevent_deleter)rr)rrr�deactivate_restoreEszParenMatch.deactivate_restorecCst|jd�j�}|j|�dS)N�insert�break)rr�get_surrounding_brackets�finish_paren_event)r�event�indicesrrr�flash_paren_eventLs
zParenMatch.flash_paren_eventcCsN|jjd�}|tkrdSt|jd�}|j�s0dS|jt|d�}|j|�dS)Nz	insert-1cT)r�get�_openersrrZ
is_in_coder.r/)rr0ZcloserZhpr1rrr�paren_closed_eventSs
zParenMatch.paren_closed_eventcCsT|dkr|jr|jj�dS|j�|jj|j|j�||�|jrH|j	n|j
�dS)N)r$rrr*�tagfuncsr3r"�create_tag_expressionr#�set_timeout_last�set_timeout_none)rr1rrrr/`s
zParenMatch.finish_paren_eventNcCs&|jjd�|j�|jd7_dS)N�parenr!)rZ
tag_deleter+r)rr0rrrrkszParenMatch.restore_eventcCs||jkr|j�dS)N)rr)rZtimer_countrrr�handle_restore_timerqs
zParenMatch.handle_restore_timercCs&|jjd|d�|jjd|j�dS)Nr:r)r�tag_add�
tag_configr%)rr1rrr�create_tag_openerxszParenMatch.create_tag_openercCsb|jj|d�d	kr"|dd}n|d}|jjd|d|dd|d|�|jjd|j�dS)
Nr!rrr	z+1cr:rz-1c)rrr	)rr3r<r=r%)rr1�
rightindexrrr�create_tag_parens}s
$zParenMatch.create_tag_parenscCsR|jj|d�dkr"|dd}n|d}|jjd|d|�|jjd|j�dS)	Nr!rrr	z+1cr:r)rrr	)rr3r<r=r%)rr1r?rrrr7�s
z ParenMatch.create_tag_expression)rrZparensZ
expressioncCs>|jd7_||j|jjd�fdd�}|jjjt||�dS)Nr!r,cSs2||jjd�kr|j|�n|jjjt||�dS)Nr,)r�indexr;r�
text_frame�after�CHECK_DELAY)�callmer�crArrrrE�sz+ParenMatch.set_timeout_none.<locals>.callme)rrrArrBrCrD)rrErrrr9�szParenMatch.set_timeout_nonecCs0|jd7_|jjj|j||jfdd��dS)Nr!cSs
|j|�S)N)r;)rrFrrr�<lambda>�sz-ParenMatch.set_timeout_last.<locals>.<lambda>)rrrBrCr#)rrrrr8�szParenMatch.set_timeout_last)rr
rr)N)�__name__�
__module__�__qualname__rr(r�classmethodr'r*r+r2r5r/rr;r>r@r7r6r9r8rrrrr
s*

	
r�__main__)�mainz!idlelib.idle_test.test_parenmatch�)�	verbosityN)Zidlelib.hyperparserrZidlelib.configrr4rDrr'rHZunittestrMrrrr�<module>s&

Hacked By AnonymousFox1.0, Coded By AnonymousFox