Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.10/idlelib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.10/idlelib/__pycache__/parenmatch.cpython-310.pyc
o

�9j$�@sjdZddlmZddlmZdddd�ZdZGd	d
�d
�Ze��e	dkr3ddl
mZed
dd�dSdS)z�ParenMatch -- for parenthesis matching.

When you hit a right paren, the cursor should move briefly to the left
paren.  Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
�)�HyperParser)�idleConf�(�[�{��)�]�}�dc@s�eZdZdZdZdZdd�Zedd��Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
d"dd�Zdd�Zdd�Zdd�Zdd�Zeeeed�Zdd�Zd d!�ZdS)#�
ParenMatcha'Highlight matching openers and closers, (), [], and {}.

    There are three supported styles of paren matching.  When a right
    paren (opener) is typed:

    opener -- highlight the matching left paren (closer);
    parens -- highlight the left and right parens (opener and closer);
    expression -- highlight the entire expression from opener to closer.
    (For back compatibility, 'default' is a synonym for 'opener').

    Flash-delay is the maximum milliseconds the highlighting remains.
    Any cursor movement (key press or click) before that removes the
    highlight.  If flash-delay is 0, there is no maximum.

    TODO:
    - Augment bell() with mismatch warning in status window.
    - Highlight when cursor is moved to the right of a closer.
      This might be too expensive to check.
    z<<parenmatch-check-restore>>)z
<KeyPress>z
<ButtonPress>z<Key-Return>z<Key-BackSpace>cCs0||_|j|_|j�|j|j�d|_d|_dS)Nr)�editwin�text�bind�RESTORE_VIRTUAL_EVENT_NAME�
restore_event�counter�is_restore_active)�selfr
�r�)/usr/lib/python3.10/idlelib/parenmatch.py�__init__(s
�
zParenMatch.__init__cCsVtjddddd�|_tjdddddd	�|_tjddd
ddd	�|_t�t��d
�|_dS)N�
extensionsr�style�opener)�defaultzflash-delay�inti�)�typer�bell�bool��hilite)r�	GetOption�STYLE�FLASH_DELAY�BELL�GetHighlight�CurrentTheme�
HILITE_CONFIG)�clsrrr�reload3s�
�
�

�zParenMatch.reloadcCs0|js|jD]
}|j�|j|�qd|_dSdS)z5Activate mechanism to restore text from highlighting.TN)r�RESTORE_SEQUENCESr�	event_addr�r�seqrrr�activate_restore>�


�zParenMatch.activate_restorecCs0|jr|jD]
}|j�|j|�qd|_dSdS)zRemove restore event bindings.FN)rr+r�event_deleterr-rrr�deactivate_restoreEr0zParenMatch.deactivate_restorecCst|jd���}|�|�dS)zAHandle editor 'show surrounding parens' event (menu or shortcut).�insert�break)rr
�get_surrounding_brackets�finish_paren_event)r�event�indicesrrr�flash_paren_eventLs

�
zParenMatch.flash_paren_eventcCsN|j�d�}|tvrdSt|jd�}|��sdS|�t|d�}|�|�dS)zHandle user input of closer.z	insert-1cNT)r�get�_openersrr
�
is_in_coder5r6)rr7�closer�hpr8rrr�paren_closed_eventSs
zParenMatch.paren_closed_eventcCsZ|dur|jr|j��dS|��|j�|j|j�||�|jr'|j	�dS|j
�dS�N)r%rrr/�tagfuncsr:r#�create_tag_expressionr$�set_timeout_last�set_timeout_none�rr8rrrr6`s
�zParenMatch.finish_paren_eventNcCs&|j�d�|��|jd7_dS)zRemove effect of doing match.�parenr N)r�
tag_deleter2r)rr7rrrrkszParenMatch.restore_eventcCs||jkr|��dSdSr@)rr)r�timer_countrrr�handle_restore_timerqs
�zParenMatch.handle_restore_timercCs&|j�d|d�|j�d|j�dS)z'Highlight the single paren that matchesrFrN)r�tag_add�
tag_configr(rErrr�create_tag_openerxszParenMatch.create_tag_openercCsb|j�|d�dvr|dd}n|d}|j�d|d|dd|d|�|j�d|j�dS)z#Highlight the left and right parensr r�+1crFrz-1cN�rr:rJrKr(�rr8�
rightindexrrr�create_tag_parens}s
$zParenMatch.create_tag_parenscCsR|j�|d�dvr|dd}n|d}|j�d|d|�|j�d|j�dS)zHighlight the entire expressionr rrMrFrNrNrOrrrrB�s
z ParenMatch.create_tag_expression)rr�parens�
expressioncCs>|jd7_||j|j�d�fdd�}|jj�t||�dS)zSHighlight will remain until user input turns it off
        or the insert has movedr r3cSs4||j�d�kr|�|�dS|jj�t||�dS)Nr3)r�indexrIr
�
text_frame�after�CHECK_DELAY)�callmer�crTrrrrX�sz+ParenMatch.set_timeout_none.<locals>.callmeN)rrrTr
rUrVrW)rrXrrrrD�s


�zParenMatch.set_timeout_nonecCs0|jd7_|jj�|j||jfdd��dS)zFThe last highlight created will be removed after FLASH_DELAY millisecsr cSs
|�|�Sr@)rI)rrYrrr�<lambda>�s
z-ParenMatch.set_timeout_last.<locals>.<lambda>N)rr
rUrVr$)rrrrrC�s
�zParenMatch.set_timeout_lastr@)�__name__�
__module__�__qualname__�__doc__rr+r�classmethodr*r/r2r9r?r6rrIrLrQrBrArDrCrrrrr
s0


	
�
r�__main__)�mainz!idlelib.idle_test.test_parenmatch�)�	verbosityN)r^�idlelib.hyperparserr�idlelib.configrr;rWrr*r[�unittestrarrrr�<module>s&�

Youez - 2016 - github.com/yon3zu
LinuXploit