• File: codecontext.cpython-37.opt-2.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/idlelib/__pycache__/codecontext.cpython-37.opt-2.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 5.57 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

YI~d>,@sddlZddlmZddlZddlmZmZddlm	Z	ddddd	d
ddd
dddhZ
edfddZddZ
GdddZeedkrddlmZedddddS)N)maxsize)NSEWSUNKEN)idleConfclassdefifelifelsewhilefortryexceptfinallywithasyncz^(\s*)(\w*)cCs||S)N)matchgroups)codelinecr8/opt/alt/python37/lib64/python3.7/idlelib/codecontext.pyget_spaces_firstwordsrcCsFt|\}}t|}t||ks,||dkr0t}|tko:|}|||fS)N#)rlenINFINITYBLOCKOPENERS)rZspacesZ	firstwordindentopenerrrr
get_line_infosrc@sreZdZdZddZddZeddZdd	ZdddZ	dddZ
ddZdddZddZ
ddZddZd
S)CodeContextdcCs||_|j|_|dS)N)editwintext_reset)selfr"rrr__init__.szCodeContext.__init__cCs$d|_d|_d|_d|_dg|_dS)N)rF)contextcell00t1
topvisibleinfo)r%rrrr$Cs
zCodeContext._resetcCstjdddddd|_dS)N
extensionsr Zmaxlinesint)typedefault)rZ	GetOption
context_depth)clsrrrreloadJszCodeContext.reloadcCs>|jdk	r:y|j|jWntjk
r2YnXd|_dS)N)r,r#after_canceltkinterTclError)r%rrr__del__Qs
zCodeContext.__del__Nc

Cs~|jdkr(|jj|jjf}d}d}xh|D]`}||jjkrB|n|}||j|d7}||j|d7}||j|d7}q*Wt	j
|jjddd||tdd}|_||
|d|j||jddtdttd	}t	j|jj|d
d|_|jjddtdd}	n:|jd|_|jd|_|j|j|d
}	|jjdd|	dddS)Nrpadxborderr'disabled)heightwidthZhighlightthicknessr;r<Zreliefstatez<ButtonRelease-1>)rowcolumnZsticky
linenumber
background)bgZHideZShowoptionsz* Code Contextz
 Code Context)ZmenuindexZlabelbreak)r*r"r#Z
text_frameZ	grid_infoZ	pack_infoZtkZgetintZcgetr8ZTextrupdate_fontupdate_highlight_colorsZbind
jumptolinetimer_eventZgridrrGetHighlightCurrentThemeZFramer+Zdestroyr7r,r$Zupdate_menu_label)
r%eventZwidgetsr;r<Zwidgetr.r*line_number_colorsZmenu_statusrrrtoggle_code_context_eventZsJ





z%CodeContext.toggle_code_context_eventr'rcCsg}t}xt||ddD]x}|j|d|d}t|\}}	}
||kr|}|
dkrb|d7}|
r||kr||kr||||	|
f||krPqW|||fS)Nr'r(z.0z.end)r
r	)rranger#getrappendreverse)r%new_topvisibleZstopline
stopindentlines
lastindentZlinenumrrr#rrrrget_contexts
zCodeContext.get_contextcCsJ|jd}|j|krdS|j|krX|||j\}}x|jdd|krT|jd=q8Wn`|jddd}x,|jdd|kr|jdd}|jd=qlW|||jddd|\}}|j|||_dd|j|jdD}|drdnd}t|||jd<d|jd	<|j	d
d|j
dd||dd
|jd	<dS)Nz@0,0r(r'rcSsg|]}|dqS)r).0xrrr
<listcomp>sz3CodeContext.update_code_context.<locals>.<listcomp>r>Znormalr@z1.0end
r=)r"Z	getlinenor-rZr.extendr4rr*deleteinsertjoin)r%rVrXrYrWZcontext_stringsZ	showfirstrrrupdate_code_contexts0



zCodeContext.update_code_contextcCsy|jdWntjk
rt|j}|dkr:d}n:tt|jd}td||j	d}|j||d}|j
|d|YnXdS)Nz	sel.firstr'rcrz.0)
r*rGr8r9rr.r0floatmaxr4r#Zyviewre)r%rOrXZnewtopZcontextlineoffsetrrrrKs
zCodeContext.jumptolinecCs*|jdk	r&||j|j|j|_dS)N)r*rer#ZafterUPDATEINTERVALrLr,)r%rrrrLs
zCodeContext.timer_eventcCs(|jdk	r$t|jdd}||jd<dS)NmainZEditorWindowfont)r*rZGetFontr#)r%rkrrrrIs
zCodeContext.update_fontcCsf|jdk	r6ttd}|d|jd<|d|jd<|jdk	rbttd}|jj|dddS)Nr*rDZ
foregroundrC)rE)r*rrMrNr+Zconfig)r%ZcolorsrPrrrrJs


z#CodeContext.update_highlight_colors)N)r'r)N)__name__
__module____qualname__rir&r$classmethodr6r:rQrZrerKrLrIrJrrrrr *s	
8
(
r __main__)rjz"idlelib.idle_test.test_codecontextr[F)	verbosityexit)resysrrr8Ztkinter.constantsrrZidlelib.configrrcompilerrr r6rlZunittestrjrrrr<module>s[