b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / idlelib /
Filename/usr/lib64/python2.6/idlelib/CodeContext.pyc
Size6.58 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 09:39
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sËdZddkZddklZlZlZlZlZddkZddk l
Z ddk l
Z
edddd d
d d d
dddg �ZdZdZeid�d�Zddd��YZdS(sICodeContext - Extension to display the block context above the edit window

Once code has scrolled off the top of a window, it can be difficult to
determine which block you are in. This extension implements a pane at the top
of each IDLE edit window which provides block structure hints. These hints are
the lines which contain the block opening keywords, e.g. 'if', for the
enclosing block. The number of hint lines is determined by the numlines
variable in the CodeContext section of config-extensions.def. Lines which do
not open blocks are not shown in the context hints pane.

iÿÿÿÿN(tTOPtLEFTtXtWtSUNKEN(tmaxint(tidleConftclasstdefteliftelsetexcepttfinallytfortifttrytwhiletwithidiès ^(\s*)(\w*)cCs|i|�i�S((tmatchtgroups(tstc((s+/usr/lib64/python2.6/idlelib/CodeContext.pyt<lambda>st CodeContextcBsÅeZddgfgZeiddddddd �Zeiddd
dd dd �Zeiddd
dd dd�Zd�Zdd�Z
d�Z ddd�Z d�Z
d�Zd�ZRS(toptionss!Code Conte_xts<<toggle-code-context>>t
extensionsRtnumlinesttypetinttdefaultitbgcolortstrt LightGraytfgcolortBlackcCsÈ||_|i|_|id|_d|_dddtfg|_d|_ti dddd d
d t�}|o!|i
�|ii d t �n|ii
t|i�|ii
t|i�dS(
NtfontiiÿÿÿÿtiRRtvisibleRtboolRs<<toggle-code-context>>(teditwinttextttextfonttNonetlabeltFalsetinfot
topvisibleRt GetOptionttoggle_code_context_eventtsetvartTruetaftertUPDATEINTERVALt timer_eventtFONTUPDATEINTERVALtfont_timer_event(tselfR'R%((s+/usr/lib64/python2.6/idlelib/CodeContext.pyt__init__"s     
cCs�|ip;|ii|iif}d}xM|D]E}|tt|i�d��7}|tt|id���7}q/Wd}x-|D]%}|tt|id���7}q�Wti |ii
dd|i ddt dt
d |id
|id |id dd|d|d
t�
|_|iidtdtdtd|ii�n|ii�d|_tidddt|idj ��ti�dS(NitpadxtborderR(s
itanchortjustifyR#tbgtfgtwidthtrelieftsidetfilltexpandtbeforeRRR%(R+R'R(t
text_frameRRt pack_infotcgettTkintertLabelttopt
context_depthRRR)RR!RtpackRRR,tdestroyR*Rt SetOptiontSaveUserCfgFiles(R8teventtwidgetsR:twidgetR;((s+/usr/lib64/python2.6/idlelib/CodeContext.pyR07s4
 ##    
 cCs�|iid|d|�}t|�\}}|tjo|}t|�t|�jp|t|�djo
t}n
t|�}|||fS(sÖGet the line indent value, text, and any block start keyword

If the line does not start a block, the keyword value is False.
The indentation of empty lines (or comment lines) is INFINITY.

s%d.0s%d.endt#(R(tgettgetspacesfirstwordt BLOCKOPENERStlentINFINITY(R8tlinenumR(tspacest firstwordtopenertindent((s+/usr/lib64/python2.6/idlelib/CodeContext.pyt
get_line_info[s0
 iic
Csï|djpt�g}t}x¸t||dd�D] }|i|�\}}} ||jou|}| djo|d7}n| o7||jo*||jo|i|||| f�n||joPq×q7q7W|i�||fS(säGet context lines, starting at new_topvisible and working backwards.

Stop when stopline or stopindent is reached. Return a tuple of context
data and the indent level at the top of the region inspected.

iiiÿÿÿÿR
R (R
R (tAssertionErrorRYtxrangeR_tappendtreverse(
R8tnew_topvisibletstoplinet
stopindenttlinest
lastindentRZR^R(R]((s+/usr/lib64/python2.6/idlelib/CodeContext.pyt get_contextks 

!


cCs®t|iid�id�d�}|i|jodS|i|joI|i||i�\}}x¹|idd|jo|id=qhWn�|i|jo~|iddd}x8|idd|jo|idd}|id=q»W|i||iddd|�\}}n|ii|�||_dgtd|i t
|i��}|g}|i|i D]}||dqy~7}d i |�|i d
<dS( sKUpdate context information and lines visible in the context pane.

s@0,0t.iNiÿÿÿÿiR$is
R((
RR(tindextsplitR.RiR-textendtmaxRLRXtjoinR+(R8RdRgRhRftcontext_stringst_[1]tx((s+/usr/lib64/python2.6/idlelib/CodeContext.pytupdate_code_context�s.%   &4cCs2|io|i�n|iit|i�dS(N(R+RsR(R3R4R5(R8((s+/usr/lib64/python2.6/idlelib/CodeContext.pyR5¦s
cCs^|id}|io-||ijo||_|i|id<n|iit|i�dS(NR#(R(R+R)R3R6R7(R8t newtextfont((s+/usr/lib64/python2.6/idlelib/CodeContext.pyR7«s

 (s!Code Conte_xts<<toggle-code-context>>N(t__name__t
__module__tmenudefsRR/RLRR!R9R*R0R_RiRsR5R7(((s+/usr/lib64/python2.6/idlelib/CodeContext.pyRs     $  ((t__doc__RIt TkconstantsRRRRRtretsysRRYtidlelib.configHandlerRtsetRWR4R6tcompileRVR(((s+/usr/lib64/python2.6/idlelib/CodeContext.pyt<module> s (