AlkantarClanX12

Your IP : 3.12.148.180


Current Path : /opt/alt/python33/lib64/python3.3/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/idlelib/__pycache__/ParenMatch.cpython-33.pyo

�
��f�c@s^dZddlmZddlmZidd6dd6dd	6Zd
ZGdd�d�Zd
S(u�ParenMatch -- An IDLE extension 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.
i(uHyperParser(uidleConfu(u)u[u]u{u}idcBsL|EeZdZdZdd1gfgZejddddd�Zejddd	d
ddd�Zej	ej
�d
�Zejdddd
ddd�ZdZ
d2Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd0d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0S(3u
ParenMatchu�Highlight matching parentheses

    There are three supported style of paren matching, based loosely
    on the Emacs options.  The style is select based on the
    HILITE_STYLE attribute; it can be changed used the set_style
    method.

    The supported styles are:

    default -- When a right paren is typed, highlight the matching
        left paren for 1/2 sec.

    expression -- When a right paren is typed, highlight the entire
        expression from the left paren to the right paren.

    TODO:
        - extend IDLE with configuration dialog to change options
        - implement rest of Emacs highlight styles (see below)
        - print mismatch warning in IDLE status window

    Note: In Emacs, there are several styles of highlight where the
    matching paren is highlighted whenever the cursor is immediately
    to the right of a right paren.  I don't know how to do that in Tk,
    so I haven't bothered.
    uedituShow surrounding parensu<<flash-paren>>u
extensionsustyleudefaultu
expressionuflash-delayutypeuinti�uhiliteubellubooliu<<parenmatch-check-restore>>u
<KeyPress>u
<ButtonPress>u<Key-Return>u<Key-BackSpace>cCsT||_|j|_|jj|j|j�d|_d|_|j|j�dS(Ni(	ueditwinutextubinduRESTORE_VIRTUAL_EVENT_NAMEu
restore_eventucounteruis_restore_activeu	set_styleuSTYLE(uselfueditwin((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu__init__;s	
		uParenMatch.__init__cCsC|js?x'|jD]}|jj|j|�qWd|_ndS(NT(uis_restore_activeuRESTORE_SEQUENCESutextu	event_adduRESTORE_VIRTUAL_EVENT_NAMEuTrue(uselfuseq((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuactivate_restoreGs	uParenMatch.activate_restorecCsC|jr?x'|jD]}|jj|j|�qWd|_ndS(NF(uis_restore_activeuRESTORE_SEQUENCESutextuevent_deleteuRESTORE_VIRTUAL_EVENT_NAMEuFalse(uselfuseq((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyudeactivate_restoreMs	uParenMatch.deactivate_restorecCs[||_|dkr0|j|_|j|_n'|dkrW|j|_|j|_ndS(Nudefaultu
expression(uSTYLEucreate_tag_defaultu
create_taguset_timeout_lastuset_timeoutucreate_tag_expressionuset_timeout_none(uselfustyle((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu	set_styleSs	uParenMatch.set_stylecCsWt|jd�j�}|dkr2|j�dS|j�|j|�|j�dS(Nuinsert(uHyperParserueditwinuget_surrounding_bracketsuNoneuwarn_mismatcheduactivate_restoreu
create_taguset_timeout_last(uselfueventuindices((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuflash_paren_event\s


uParenMatch.flash_paren_eventcCs�|jjd�}|tkr"dSt|jd�}|j�sDdS|jt|d�}|dkrt|j	�dS|j
�|j|�|j�dS(Nu	insert-1cT(
utextugetu_openersuHyperParserueditwinu
is_in_codeuget_surrounding_bracketsuTrueuNoneuwarn_mismatcheduactivate_restoreu
create_taguset_timeout(uselfueventucloseruhpuindices((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuparen_closed_eventes


uParenMatch.paren_closed_eventcCs-|jjd�|j�|jd7_dS(Nupareni(utextu
tag_deleteudeactivate_restoreucounter(uselfuevent((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu
restore_eventus
uParenMatch.restore_eventcCs ||jkr|j�ndS(N(ucounteru
restore_event(uselfutimer_count((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuhandle_restore_timerzsuParenMatch.handle_restore_timercCs|jr|jj�ndS(N(uBELLutextubell(uself((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuwarn_mismatched~s	uParenMatch.warn_mismatchedcCs1|jjd|d�|jjd|j�dS(u'Highlight the single paren that matchesupareniN(utextutag_addu
tag_configu
HILITE_CONFIG(uselfuindices((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyucreate_tag_default�suParenMatch.create_tag_defaultcCsk|jj|d�d	kr-|dd}n
|d}|jjd|d|�|jjd|j�dS(
uHighlight the entire expressioniu)u]u}u+1cupareniN(u)u]u}(utextugetutag_addu
tag_configu
HILITE_CONFIG(uselfuindicesu
rightindex((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyucreate_tag_expression�s

u ParenMatch.create_tag_expressioncCsP|jd7_||j|jjd�dd�}|jjjt||�dS(uSHighlight will remain until user input turns it off
        or the insert has movediuinsertcSsE||jjd�kr(|j|�n|jjjt||�dS(Nuinsert(utextuindexuhandle_restore_timerueditwinu
text_frameuafteruCHECK_DELAY(ucallmeuselfucuindex((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyucallme�su+ParenMatch.set_timeout_none.<locals>.callmeN(ucounterutextuindexueditwinu
text_frameuafteruCHECK_DELAY(uselfucallme((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuset_timeout_none�s	uParenMatch.set_timeout_nonecCs;|jd7_|jjj|j||jdd��dS(u7The last highlight created will be removed after .5 secicSs
|j|�S(N(uhandle_restore_timer(uselfuc((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu<lambda>�su-ParenMatch.set_timeout_last.<locals>.<lambda>N(ucounterueditwinu
text_frameuafteruFLASH_DELAY(uself((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyuset_timeout_last�suParenMatch.set_timeout_lastN(uShow surrounding parensu<<flash-paren>>(u
<KeyPress>u
<ButtonPress>u<Key-Return>u<Key-BackSpace>(u__name__u
__module__u__qualname__u__doc__umenudefsuidleConfu	GetOptionuSTYLEuFLASH_DELAYuGetHighlightuCurrentThemeu
HILITE_CONFIGuBELLuRESTORE_VIRTUAL_EVENT_NAMEuRESTORE_SEQUENCESu__init__uactivate_restoreudeactivate_restoreu	set_styleuflash_paren_eventuparen_closed_eventuNoneu
restore_eventuhandle_restore_timeruwarn_mismatcheducreate_tag_defaultucreate_tag_expressionuset_timeout_noneuset_timeout_last(u
__locals__((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu
ParenMatchs4			u
ParenMatchN(u__doc__uidlelib.HyperParseruHyperParseruidlelib.configHandleruidleConfu_openersuCHECK_DELAYu
ParenMatch(((u7/opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu<module>s