Viewing 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¢
Back to Directory File Manager