Viewing File: /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/CodeContext.cpython-35.opt-2.pyc



] @sddlZddlmZmZmZmZmZddlZddlm	Z
ddlmZddddd	d
ddd
ddhZ
dZdZejdddZGdddZdS)N)TOPLEFTXWSUNKEN)maxsize)idleConfclassdefelifelseexceptfinallyforiftrywhilewithdiz^(\s*)(\w*)cCs|j|jS)N)matchgroups)scr0/opt/alt/python35/lib64/python3.5/CodeContext.py<lambda>src@seZdZdd gfgZejddddddd	Zejddd
ddddZejddd
ddddZddZ	dddZ
ddZddddZddZ
ddZddZdS)!CodeContextoptions!Code Conte_xt<<toggle-code-context>>
extensionsZnumlinestypeintdefaultbgcolorstrZ	LightGrayfgcolorZBlackcCs||_|j|_|jd|_d|_dg|_d|_tjdddd	d
dd}|r|j|jj	dd
|jj
t|j|jj
t
|jdS)NfontrFr rvisibler!boolr#z<<toggle-code-context>>T)rr-r*F)editwintexttextfontlabelinfo
topvisibler	GetOptiontoggle_code_context_eventZsetvarafterUPDATEINTERVALtimer_eventFONTUPDATEINTERVALfont_timer_event)selfr.r+rrr__init__"s			
zCodeContext.__init__NcCs|jsC|jj|jjf}d}xM|D]E}||jj|jd7}||jj|jd7}q.Wd}x-|D]%}||jj|jd7}qWtj	|jj
dd|jddtdt
d	|jd
|jd|jddd|d|d
t
|_|jjdtdtddd|jjn|jjd|_tjdddt|jdk	tjdS)Nrpadxborderr/
r)ZanchorZjustifyr(bgZfgwidthZreliefZsidefillexpandFZbeforer rr+)r1r.r/Z
text_frameZtkZgetintZ	pack_infoZcgettkinterZLabeltop
context_depthrrr0r%r'rpackrrZdestroyrZ	SetOptionr&ZSaveUserCfgFiles)r;eventZwidgetsr=Zwidgetr>rrrr57s0	
 #
#	
	z%CodeContext.toggle_code_context_eventcCs|jjd|d|}t|\}}|tko>|}t|t|kso|t|dkrxt}nt|}|||fS)Nz%d.0z%d.end#)r/getgetspacesfirstwordBLOCKOPENERSlenINFINITY)r;linenumr/ZspacesZ	firstwordopenerindentrrr
get_line_info[s.	zCodeContext.get_line_infor)rc
Csg}t}xt||ddD]}|j|\}}}	||kr#|}|	dkri|d7}|	r||kr||kr|j||||	f||kr#Pq#W|j||fS)Nr)rrr-)rr)rNrangerRappendreverse)
r;new_topvisibleZstopline
stopindentlines
lastindentrOrQr/rPrrrget_contextks

zCodeContext.get_contextcCst|jjdjdd}|j|kr8dS|j|kr|j||j\}}x|jd
d|kr|jd=qeWn|j|kr|jddd}x6|jd
d|kr|jdd}|jd=qW|j||jddd|\}}|jj|||_dgtd|j	t
|j}|dd|j|j	dD7}dj||jd	<dS)Nz@0,0.rr)r*cSsg|]}|dqS)r).0xrrr
<listcomp>s	z3CodeContext.update_code_context.<locals>.<listcomp>r?r/r-r-r-r-r-r-r-)
r"r/indexsplitr3rZr2extendmaxrFrMjoinr1)r;rVrXrYrWZcontext_stringsrrrupdate_code_contexts*%			&(zCodeContext.update_code_contextcCs-|jr|j|jjt|jdS)N)r1rer/r6r7r8)r;rrrr8s	
zCodeContext.timer_eventcCsX|jd}|jr>||jkr>||_|j|jd<|jjt|jdS)Nr()r/r1r0r6r9r:)r;Znewtextfontrrrr:s

	zCodeContext.font_timer_event)rr)__name__
__module____qualname__Zmenudefsrr4rFr%r'r<r5rRrZrer8r:rrrrrs$ r)rDZtkinter.constantsrrrrrresysrrNZidlelib.configHandlerrrLr7r9compilerKrrrrr<module>s(
Back to Directory File Manager