Your IP : 18.188.62.10


Current Path : /opt/alt/python34/lib64/python3.4/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/idlelib/__pycache__/StackViewer.cpython-34.pyo

�
f fJ�@sddlZddlZddlZddlZddlZddlmZmZm	Z	ddl
mZmZddl
mZddddd�ZGdd�de�ZGd	d
�d
e�ZGdd�de�Zd
d�Zedkr
ddlmZee�ndS)�N)�TreeNode�TreeItem�ScrolledCanvas)�ObjectTreeItem�make_objecttreeitem)�PyShellFileListcCs�|dkrtj|�}nt|dddd�}|jjdddd�t||�}t|jd|�}|j�dS)	NZbgZwhiteZhighlightthicknessr�expand�ZfillZboth)	�tkZToplevelr�frameZpack�
StackTreeItemrZcanvasr)�root�flist�tb�topZsc�itemZnode�r�8/opt/alt/python34/lib64/python3.4/idlelib/StackViewer.py�StackBrowsersrc@sReZdZdddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)rNcCs.||_|j|�|_|j�|_dS)N)r�	get_stack�stack�
get_exception�text)�selfrrrrr�__init__s	zStackTreeItem.__init__cCsx|dkrtj}ng}|r?|jdkr?|j}nx2|dk	rs|j|j|jf�|j}qBW|S)N)�sys�last_traceback�tb_frame�tb_next�append�	tb_lineno)rrrrrrrs
zStackTreeItem.get_stackcCs`tj}tj}t|d�r-|j}nt|�}|dk	r\|dt|�}n|S)N�__name__z: )r�	last_type�
last_value�hasattrr!�str)r�type�value�srrrr&s		zStackTreeItem.get_exceptioncCs|jS)N)r)rrrr�GetText0szStackTreeItem.GetTextcCs=g}x0|jD]%}t||j�}|j|�qW|S)N)r�
FrameTreeItemrr)r�sublist�inforrrr�
GetSubList3s
zStackTreeItem.GetSubList)r!�
__module__�__qualname__rrrr)r-rrrrrs

rc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r*cCs||_||_dS)N)r,r)rr,rrrrr<s	zFrameTreeItem.__init__c	Cs�|j\}}y|jd}Wnd}YnX|j}|j}|j}tj||�}|j�}|dkr�d|||f}nd||||f}|S)Nr!�?�z%s, line %d: %sz%s.%s(...), line %d: %s)r0r1N)r,�	f_globals�f_code�co_filename�co_name�	linecache�getline�strip)	rr�lineno�modname�code�filenameZfuncnameZ
sourcelinerrrrr)@s				
zFrameTreeItem.GetTextcCsx|j\}}g}|j|jk	rOtd|j|j�}|j|�ntd|j|j�}|j|�|S)Nz<locals>z	<globals>)r,r2�f_locals�VariablesTreeItemrr)rrr9r+rrrrr-Rs
zFrameTreeItem.GetSubListcCsS|jrO|j\}}|jj}tjj|�rO|jj||�qOndS)N)rr,r3r4�os�path�isfileZgotofileline)rrr9r<rrr�
OnDoubleClick\s
	zFrameTreeItem.OnDoubleClickN)r!r.r/rr)r-rBrrrrr*:s
r*c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r>cCs|jS)N)Z	labeltext)rrrrr)eszVariablesTreeItem.GetTextcCsdS)Nr)rrrr�GetLabelTexthszVariablesTreeItem.GetLabelTextcCst|j�dkS)Nr)�len�object)rrrr�IsExpandablekszVariablesTreeItem.IsExpandablec
Cs�g}xx|jj�D]g}y|j|}Wntk
rDwYnX||jdd�}t|d||�}|j|�qW|S)NcSs|||<dS)Nr)r'�keyrErrr�setfunctionusz1VariablesTreeItem.GetSubList.<locals>.setfunctionz =)rE�keys�KeyErrorrr)rr+rGr'rHrrrrr-ns
zVariablesTreeItem.GetSubListcCst|jj��S)N)�listrErI)rrrrrI{szVariablesTreeItem.keysN)r!r.r/r)rCrFr-rIrrrrr>cs

r>c
Cs�tj�}|jd�ttttjd|j����\}}}}|jd||df�t	|�}yt
Wn'tk
r�tj
�\}}}	YnX|t_|t_|	t_t|d|d|d|	�t`t`t`dS)NzTest StackViewerz[x+]z+%d+%d�rrr)r
ZTk�titlerK�map�int�re�splitZgeometryrZintentional_name_error�	NameErrorr�exc_infor"r#rr)
�parentr
�widthZheight�x�yr�exc_type�	exc_valueZexc_tbrrr�
_stack_viewer~s 
3
			rZ�__main__)�run)r?rr6rPZtkinterr
Zidlelib.TreeWidgetrrrZidlelib.ObjectBrowserrrZidlelib.PyShellrrrr*r>rZr!Zidlelib.idle_test.htestr\rrrr�<module>s	&)

?>