File "ColorDelegator.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/ColorDelegator.cpython-34.pyc
File size: 7.84 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e f%@sddlZddlZddlZddlZddlmZddlmZdZddZ	ddZ
eje
ejZ
ejd	ejZGd
ddeZdd
ZedkrddlmZeendS)N)	Delegator)idleConfFcCsd|dj|dS)z9Return a named group pattern matching list of alternates.z(?P<%s>|))join)nameZ
alternatesr;/opt/alt/python34/lib64/python3.4/idlelib/ColorDelegator.pyany
sr
c
Csdtdtjd}ddttD}dtd|d}tddg}d	}|d
}|d}|d}|d
}td||||g}	|d|d|d|	dtddgS)Nz\bKEYWORDcSs;g|]1}|jdr|tjkrt|qS)_)
startswithkeywordkwliststr).0rrrr	
<listcomp>s	zmake_pat.<locals>.<listcomp>z([^.'\"\\#]\b|^)BUILTINCOMMENTz#[^\n]*z4(\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR|rb|rB|Rb|RB)?z'[^'\\\n]*(\\.[^'\\\n]*)*'?z"[^"\\\n]*(\\.[^"\\\n]*)*"?z''''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?z'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?STRINGrSYNCz\n)r
rrdirbuiltins)
kwZbuiltinlistbuiltincommentZstringprefixZsqstringZdqstringZ	sq3stringZ	dq3stringstringrrr	make_pats



rz\s+(\w+)c@seZdZddZddZddZddZd	d
dZd	dd
Zd	Z	dZ
dZd	ddZd	Z
d	ddZddZddZddZddZd	S)ColorDelegatorcCs-tj|t|_t|_|jdS)N)r__init__progidprogLoadTagDefs)selfrrr	r%s
		zColorDelegator.__init__cCs|jdk	r|jdntj|||dk	rk|j|jd|j|jddnd|_d|_	dS)Nz<<toggle-auto-coloring>>z1.0endTF)
delegateZunbindrsetdelegate
config_colorsZbindtoggle_colorize_eventnotify_rangestop_colorizingallow_colorizing)r#r%rrr	r&+s
	zColorDelegator.setdelegatecCsJx6|jjD]%\}}|r|j||qqW|jddS)NZsel)tagdefsitemsZ
tag_configureZ	tag_raise)r#tagZcnfrrr	r'8szColorDelegator.config_colorscCstj}i	tj|dd6tj|dd6tj|dd6tj|dd6tj|d	d
6idd6dd6d
6idd6dd6d6tj|dd6tj|dd6|_trtd|jndS)NrrrrrrrrZ
definition
DEFINITION
backgroundZ
foregroundrTODOerrorZERRORZhitr,)rZCurrentThemeZGetHighlightr,DEBUGprint)r#Zthemerrr	r">szColorDelegator.LoadTagDefsNcCsG|j|}|jj||||j||dt|dS)Nz+%dc)indexr%insertr)len)r#r5charsZtagsrrr	r6OszColorDelegator.insertcCs3|j|}|jj|||j|dS)N)r5r%deleter))r#index1index2rrr	r9TszColorDelegator.deleteTFcCs|jd|||jr3tr/tdndS|jr[d|_tr[tdq[n|jrtrwtdn|jd|j|_ndS)Nr1zcolorizing already scheduledTzstop colorizingzschedule colorizing)	tag_addafter_idr3r4
colorizingr*r+after
recolorize)r#r:r;rrr	r)]s	
			
zColorDelegator.notify_rangecCs||jr>|j}d|_tr.tdn|j|nd|_d|_|rx|jsl|jqx||_ndS)Nzcancel scheduled recolorizerFT)	r>r3r4after_cancelr+r*r?destroyclose_when_done)r#rDr>rrr	closeks			
			
zColorDelegator.closecCs|jr>|j}d|_tr.tdn|j|n|jro|jrotrctdnd|_n|j|_|jr|jr|jd|j|_ntrtd|jrdpdndS)	Nzcancel scheduled recolorizerzstop colorizingTr<zauto colorizing turnedZonZoffbreak)	r>r3r4rBr+r?r*r@rA)r#Zeventr>rrr	r(ys"			


z$ColorDelegator.toggle_colorize_eventcCsQd|_|js)tr%tdndS|jsItrEtdndS|jritretdndSzfd|_d|_trtdntj}|j	tj}trtd||nWdd|_X|jr%|j
dd	r%tr
td
n|jd|j|_n|j
rM|j
}d|_
|jndS)Nzno delegatezauto colorizing is offzalready colorizingFTz
colorizing...z%.3f secondsr1z1.0zreschedule colorizingr<)r>r%r3r4r+r?r*timeZperf_counterrecolorize_main
tag_nextranger@rArDrC)r#Zt0Zt1toprrr	rAs@		
	
	
		



			zColorDelegator.recolorizecCsd}x|jd|}|s%Pn|\}}|jd|||jd|}|ri|d}nd}d}|}d}d}x|s|}|j|d|}t|dd	}d|j|d
k}|j||}	|	sdSx$|jD]}
|j|
||qW||	}|jj	|}x|r(x|j
jD]\}}
|
rT|j|\}}|j
||d||d||
dkr|jj||}|r|jd\}}|j
d|d||d|qqqTqTW|jj	||j}q;Wd|j|d
krQ|}d}nd}|sp|j
d|n|j|jrtrtdndSqWq	WdS)Nz1.0r1rr<Fz+%d lines linestartdz-1cz+%dcdefclassr/zcolorizing stopped)zdefzclass)rI
tag_removeZ
tag_prevranger5minZ	tag_namesgetr,r search	groupdictr-spanr=r!matchr$updater*r3r4)r#nextitemheadtailr8Zlines_to_getokmarkliner.mkeyvalueabZm1rrr	rHsl
	
				
	
zColorDelegator.recolorize_maincCs+x$|jD]}|j|ddq
WdS)Nz1.0r$)r,rP)r#r.rrr	removecolorsszColorDelegator.removecolors)__name__
__module____qualname__rr&r'r"r6r9r>r+r?r)rDrEr(rArHrdrrrr	r#s 
Arc	Csddlm}m}ddlm}||}|jd|jd|jd|jdfd}||d	d
}|j	ddd
d|j
d||j||}t}|j
|dS)Nr)ToplevelText)
PercolatorzTest ColorDelegatorz
200x100+%d+%dz'if somename: x = 'abc' # comment
print
r0Zwhiteexpandr<ZfillZbothr6)ZtkinterrhriZidlelib.PercolatorrjtitleZgeometryZwinfo_rootxZwinfo_rootyZpackr6Z	focus_setrZinsertfilter)	parentrhrirjrJsourcetextpdrrr	_color_delegators

	rt__main__)run)rGrerrZidlelib.DelegatorrZidlelib.configHandlerrr3r
rcompileSr r!rrtreZidlelib.idle_test.htestrvrrrr	<module>s