AlkantarClanX12

Your IP : 18.221.102.0


Current Path : /proc/self/root/opt/alt/python33/lib64/python3.3/idlelib/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python33/lib64/python3.3/idlelib/__pycache__/CodeContext.cpython-33.pyo

�
��f� c@s�dZddlZddlmZmZmZmZmZddlZddl	m
Zddlm
Z
edddd	d
ddd
dddg�ZdZdZejd�dd�ZGdd�d�ZdS(uICodeContext - 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.

iN(uTOPuLEFTuXuWuSUNKEN(umaxsize(uidleConfuclassudefuelifuelseuexceptufinallyuforuifutryuwhileuwithidi�u^(\s*)(\w*)cCs|j|�j�S(N(umatchugroups(usuc((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyu<lambda>su<lambda>cBs�|EeZdZdd gfgZejddddddd	�Zejddd
dddd�Zejddd
dddd�Zdd�Z	ddd�Zdd�Zdddd�Z
dd�Zdd�Zdd�ZdS(!uCodeContextuoptionsu!Code Conte_xtu<<toggle-code-context>>u
extensionsunumlinesutypeuintudefaultiubgcolorustru	LightGrayufgcoloruBlackcCs�||_|j|_|jd|_d|_dg|_d|_tj	ddddd	d
d
�}|r�|j
�|jjdd�n|jj
t|j�|jj
t|j�dS(Nufontiiuu
extensionsuCodeContextuvisibleutypeubooludefaultu<<toggle-code-context>>i����F(ii����uFT(ueditwinutextutextfontuNoneulabeluFalseuinfou
topvisibleuidleConfu	GetOptionutoggle_code_context_eventusetvaruTrueuafteruUPDATEINTERVALutimer_eventuFONTUPDATEINTERVALufont_timer_event(uselfueditwinuvisible((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyu__init__"s			
uCodeContext.__init__cCs�|jsC|jj|jjf}d}xM|D]E}|tt|j�d��7}|tt|jd���7}q.Wd}x-|D]%}|tt|jd���7}q�Wtj	|jj
dd|jddtdt
d	|jd
|jd|jddd|d|d
t�
|_|jjdtdtddd|jj�n|jj�d|_tjdddt|jdk	��tj�dS(Niupadxuborderutextu
iuanchorujustifyufontubgufguwidthureliefusideufilluexpandubeforeu
extensionsuCodeContextuvisibleF(ulabelueditwinutextu
text_frameuintustru	pack_infoucgetutkinteruLabelutopu
context_depthuWuLEFTutextfontubgcolorufgcoloruSUNKENupackuTOPuXuFalseudestroyuNoneuidleConfu	SetOptionuSaveUserCfgFiles(uselfueventuwidgetsupadxuwidgetuborder((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyutoggle_code_context_event7s0	
 #
#	
	u%CodeContext.toggle_code_context_eventcCs�|jjd|d|�}t|�\}}|tko>|}t|�t|�kso|t|�dkrxt}nt|�}|||fS(u�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.

        u%d.0u%d.endu#(utextugetugetspacesfirstworduBLOCKOPENERSulenuINFINITY(uselfulinenumutextuspacesu	firstworduopeneruindent((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyu
get_line_info[s.	uCodeContext.get_line_infoiic
Cs�g}t}x�t||dd�D]�}|j|�\}}}	||kr#|}|	dkrl|d7}n|	r�||kr�||kr�|j||||	f�n||kr�Pq�q#q#W|j�||fS(u�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.

        iuelseuelifi����(uelseuelif(uINFINITYurangeu
get_line_infouappendureverse(
uselfunew_topvisibleustoplineu
stopindentulinesu
lastindentulinenumuindentutextuopener((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyuget_contextks

uCodeContext.get_contextcCs�t|jjd�jd�d�}|j|kr8dS|j|kr�|j||j�\}}x�|jdd|kr�|jd=qeWn�|j|kr|jd
dd}x6|jdd|kr�|jdd}|jd=q�W|j||jddd|�\}}n|jj|�||_dgtd|j	t
|j��}|dd�|j|j	d�D�7}d	j|�|jd
<dS(uKUpdate context information and lines visible in the context pane.

        u@0,0u.iNiucSsg|]}|d�qS(i((u.0ux((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyu
<listcomp>�s	u3CodeContext.update_code_context.<locals>.<listcomp>u
utexti����i����i����i����i����i����i����(
uintutextuindexusplitu
topvisibleuget_contextuinfouextendumaxu
context_depthulenujoinulabel(uselfunew_topvisibleulinesu
lastindentu
stopindentucontext_strings((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyuupdate_code_context�s*%			&(uCodeContext.update_code_contextcCs0|jr|j�n|jjt|j�dS(N(ulabeluupdate_code_contextutextuafteruUPDATEINTERVALutimer_event(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyutimer_event�s	
uCodeContext.timer_eventcCs[|jd}|jrA||jkrA||_|j|jd<n|jjt|j�dS(Nufont(utextulabelutextfontuafteruFONTUPDATEINTERVALufont_timer_event(uselfunewtextfont((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyufont_timer_event�s

	uCodeContext.font_timer_eventN(u!Code Conte_xtu<<toggle-code-context>>(u__name__u
__module__u__qualname__umenudefsuidleConfu	GetOptionu
context_depthubgcolorufgcoloru__init__uNoneutoggle_code_context_eventu
get_line_infouget_contextuupdate_code_contextutimer_eventufont_timer_event(u
__locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyuCodeContexts$ uCodeContext(u__doc__utkinterutkinter.constantsuTOPuLEFTuXuWuSUNKENureusysumaxsizeuINFINITYuidlelib.configHandleruidleConfusetuBLOCKOPENERSuUPDATEINTERVALuFONTUPDATEINTERVALucompileugetspacesfirstworduCodeContext(((u8/opt/alt/python33/lib64/python3.3/idlelib/CodeContext.pyu<module>s(