eaiovnaovbqoebvqoeavibavo  V~gc@sddlZddlZddlZddlZddlmZddlmZeZ dZ dZ ej e ej Zej dej ZdefdYZd Zed krdd lmZeendS( iN(t Delegator(tidleConfcCsd|dj|dS(s9Return a named group pattern matching list of alternates.s(?P<%s>t|t)(tjoin(tnamet alternates((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pytany sc Csdtdtjd}gttD]!}|jds't|^q'}|jddtd|d}tddg}d }|d }|d }|d }|d } td|| ||g} |d|d|d| dtddgS(Ns\btKEYWORDt_tprints([^.'\"\\#]\b|^)tBUILTINtCOMMENTs#[^\n]*s((\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR)?s'[^'\\\n]*(\\.[^'\\\n]*)*'?s"[^"\\\n]*(\\.[^"\\\n]*)*"?s''''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?s'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?tSTRINGRtSYNCs\n(Rtkeywordtkwlisttdirt __builtin__t startswithtstrtremove( tkwRt builtinlisttbuiltintcommentt stringprefixtsqstringtdqstringt sq3stringt dq3stringtstring((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pytmake_pats!     s\s+(\w+)tColorDelegatorcBseZdZdZdZdZd dZd dZd Z e Z e Z d dZd Zd dZdZd Zd Zd ZRS( cCs-tj|t|_t|_|jdS(N(Rt__init__tprogtidprogt LoadTagDefs(tself((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR"'s   cCs|jdk r|jdntj|||dk rk|j|jd|j|jddnt |_ t |_ dS(Ns<>s1.0tend( tdelegatetNonetunbindRt setdelegatet config_colorstbindttoggle_colorize_eventt notify_rangetTruetstop_colorizingtFalsetallow_colorizing(R&R(((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR+-s   cCsJx6|jjD]%\}}|r|j||qqW|jddS(Ntsel(ttagdefstitemst tag_configuret tag_raise(R&ttagtcnf((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR,:scCstj}i tj|dd6tj|dd6tj|dd6tj|dd6tj|d d 6idd 6dd 6d 6idd 6dd 6d6tj|dd6tj|dd6|_trdG|jGHndS(NRR RRRR RR t definitiont DEFINITIONt backgroundt foregroundRtTODOterrortERRORthitR5(Rt CurrentThemet GetHighlightR)R5tDEBUG(R&ttheme((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR%@s cCsG|j|}|jj||||j||dt|dS(Ns+%dc(tindexR(tinsertR/tlen(R&RGtcharsttags((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyRHQscCs3|j|}|jj|||j|dS(N(RGR(tdeleteR/(R&tindex1tindex2((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyRLVscCs|jd|||jr.tr*dGHndS|jrQt|_trQdGHqQn|jrtrhdGHn|jd|j|_ndS(NR?scolorizing already scheduledsstop colorizingsschedule colorizingi( ttag_addtafter_idREt colorizingR0R1R3taftert recolorize(R&RMRN((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR/_s     cCsw|jr9|j}d|_tr)dGHn|j|nt|_t|_|rs|jsg|j qs||_ ndS(Nscancel scheduled recolorizer( RPR)REt after_cancelR2R3R0R1RQtdestroytclose_when_done(R&RVRP((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pytclosems       cCs|jr9|j}d|_tr)dGHn|j|n|jre|jretrYdGHnt|_n|j |_|jr|j r|jd|j |_ntrdG|jrdpdGHndS(Nscancel scheduled recolorizersstop colorizingisauto colorizing turnedtontofftbreak( RPR)RERTR3RQR0R1RRRS(R&teventRP((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR.{s"     cCs3d|_|js$tr dGHndS|js?tr;dGHndS|jrZtrVdGHndSz\t|_t|_tr}dGHnt j }|j t j }trd||GHnWdt|_X|jr|j ddrtrdGHn|j d |j|_n|jr/|j}d|_|jndS( Ns no delegatesauto colorizing is offsalready colorizings colorizing...s %.3f secondsR?s1.0sreschedule colorizingi(R)RPR(RER3RQR2R1R0ttimetclocktrecolorize_maint tag_nextrangeRRRSRVRU(R&tt0tt1ttop((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyRSs@             cCsd}xtr|jd|}|s+Pn|\}}|jd|||jd|}|ro|d}nd}d}|}d}t}x|s|}|j|d|}t|dd}d|j|d k}|j||} | sdSx*|j j D]} |j| ||q W|| }|j j |} x| r4x| j jD]\} } | r`| j| \}}|j| |d ||d || dkr|jj||}|r|jd\}}|jd |d ||d |qqq`q`W|j j || j} qGWd|j|d kr]|}d}nt}|s||jd|n|j|jrtrdGHndSqWq WdS(Ns1.0R?Rits+%d lines linestartiids-1cs+%dctdeftclassR<scolorizing stopped(RdRe(R0R_t tag_removet tag_prevrangeR2RGtmint tag_namestgetR5tkeysR#tsearcht groupdictR6tspanROR$tmatchR'tupdateR1RE(R&tnexttitemtheadttailRJt lines_to_gettoktmarktlineR9tmtkeytvaluetatbtm1((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR^sl                cCs1x*|jjD]}|j|ddqWdS(Ns1.0R'(R5RkRf(R&R9((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyt removecolorssN(t__name__t __module__R"R+R,R%R)RHRLRPR0R3R2RQR/RVRWR.RSR^R(((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyR!%s           Ac Csddlm}m}ddlm}||}|jd|jd|jd|jdfd}||d d }|j d d d d|j d||j ||}t }|j |dS(Ni(tTopleveltText(t PercolatorsTest ColorDelegators 200x100+%d+%diis'if somename: x = 'abc' # comment print R=twhitetexpanditfilltbothRH(tTkinterRRtidlelib.PercolatorRttitletgeometryt winfo_rootxt winfo_rootytpackRHt focus_setR!t insertfilter( tparentRRRRbtsourcettexttptd((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyt_color_delegators     t__main__(trun(R\treRRtidlelib.DelegatorRtidlelib.configHandlerRR2RERR tcompiletSR#R$R!RRtidlelib.idle_test.htestR(((s;/opt/alt/python27/lib64/python2.7/idlelib/ColorDelegator.pyts