Your IP : 216.73.216.85


Current Path : /opt/alt/python39/lib64/python3.9/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/idlelib/__pycache__/parenmatch.cpython-39.opt-2.pyc

a

XC?h$�@sbddlmZddlmZdddd�ZdZGdd	�d	�Ze��ed
kr^ddl	m
Z
e
dd
d�dS)�)�HyperParser)�idleConf�(�[�{��)�]�}�dc@s�eZdZdZdZdd�Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zd!dd�Z
dd�Zdd�Zdd�Zdd�Zeeeed�Zdd�Zdd �ZdS)"�
ParenMatchz<<parenmatch-check-restore>>)z
<KeyPress>z
<ButtonPress>z<Key-Return>z<Key-BackSpace>cCs0||_|j|_|j�|j|j�d|_d|_dS)Nr)�editwin�textZbind�RESTORE_VIRTUAL_EVENT_NAME�
restore_event�counter�is_restore_active)�selfr
�r�7/opt/alt/python39/lib64/python3.9/idlelib/parenmatch.py�__init__(s
�zParenMatch.__init__cCsVtjddddd�|_tjdddddd	�|_tjddd
ddd	�|_t�t��d
�|_dS)N�
extensionsrZstyle�opener)�defaultzflash-delay�inti�)�typer�bell�bool�Zhilite)rZ	GetOption�STYLE�FLASH_DELAY�BELLZGetHighlightZCurrentTheme�
HILITE_CONFIG)�clsrrr�reload3s�
�
�
�zParenMatch.reloadcCs,|js(|jD]}|j�|j|�qd|_dS)NT)r�RESTORE_SEQUENCESrZ	event_addr�r�seqrrr�activate_restore>s
zParenMatch.activate_restorecCs,|jr(|jD]}|j�|j|�qd|_dS)NF)rr%rZevent_deleterr&rrr�deactivate_restoreEs
zParenMatch.deactivate_restorecCst|jd���}|�|�dS)N�insert�break)rr
�get_surrounding_brackets�finish_paren_event)r�event�indicesrrr�flash_paren_eventLs
zParenMatch.flash_paren_eventcCsN|j�d�}|tvrdSt|jd�}|��s0dS|�t|d�}|�|�dS)Nz	insert-1cT)r�get�_openersrr
Z
is_in_coder,r-)rr.ZcloserZhpr/rrr�paren_closed_eventSs
zParenMatch.paren_closed_eventcCsT|dur|jr|j��dS|��|j�|j|j�||�|jrH|j	n|j
�dS�N)r!rrr(�tagfuncsr1r�create_tag_expressionr �set_timeout_last�set_timeout_none�rr/rrrr-`s
�zParenMatch.finish_paren_eventNcCs&|j�d�|��|jd7_dS)N�parenr)rZ
tag_deleter)r)rr.rrrrkszParenMatch.restore_eventcCs||jkr|��dSr4)rr)rZtimer_countrrr�handle_restore_timerqs
zParenMatch.handle_restore_timercCs&|j�d|d�|j�d|j�dS)Nr:r)r�tag_add�
tag_configr"r9rrr�create_tag_openerxszParenMatch.create_tag_openercCsb|j�|d�dvr"|dd}n|d}|j�d|d|dd|d|�|j�d|j�dS)Nrr�+1cr:rz-1c�rr1r<r=r"�rr/Z
rightindexrrr�create_tag_parens}s
$zParenMatch.create_tag_parenscCsR|j�|d�dvr"|dd}n|d}|j�d|d|�|j�d|j�dS)Nrrr?r:rr@rArrrr6�s
z ParenMatch.create_tag_expression)rrZparensZ
expressioncCs>|jd7_||j|j�d�fdd�}|jj�t||�dS)Nrr*cSs2||j�d�kr|�|�n|jj�t||�dS)Nr*)r�indexr;r
�
text_frame�after�CHECK_DELAY)�callmer�crCrrrrG�sz+ParenMatch.set_timeout_none.<locals>.callme)rrrCr
rDrErF)rrGrrrr8�s

�
zParenMatch.set_timeout_nonecCs0|jd7_|jj�|j||jfdd��dS)NrcSs
|�|�Sr4)r;)rrHrrr�<lambda>��z-ParenMatch.set_timeout_last.<locals>.<lambda>)rr
rDrEr )rrrrr7�s
�zParenMatch.set_timeout_last)N)�__name__�
__module__�__qualname__rr%r�classmethodr$r(r)r0r3r-rr;r>rBr6r5r8r7rrrrr
s,



	
�
r�__main__)�mainz!idlelib.idle_test.test_parenmatch�)�	verbosityN)Zidlelib.hyperparserrZidlelib.configrr2rFrr$rKZunittestrPrrrr�<module>s&