Your IP : 18.117.254.202


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/stackviewer.cpython-36.opt-2.pyc

3

��2af�@s�ddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
mZddd�ZGdd�de
�Z
Gdd	�d	e
�ZGd
d�de�Zdd
�Zedkr�ddlmZedddd�ddlmZee�dS)�N)�ObjectTreeItem�make_objecttreeitem)�TreeNode�TreeItem�ScrolledCanvascCsT|dkrtj|�}t|ddd�atjjddd�t||�attj	dt�a
t
j�dS)NZwhiter)�bgZhighlightthickness�Zboth)�expand�fill)�tk�ToplevelrZsc�frame�pack�
StackTreeItem�itemrZcanvasZnoder	)�root�flist�tb�top�r�0/opt/alt/python36/lib64/python3.6/stackviewer.py�StackBrowser
s

rc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs ||_|j|�|_|j�|_dS)N)r�	get_stack�stack�
get_exception�text)�selfrrrrr�__init__szStackTreeItem.__init__cCsP|dkrtj}g}|r&|jdkr&|j}x$|dk	rJ|j|j|jf�|j}q(W|S)N)�sys�last_traceback�tb_frame�tb_next�append�	tb_lineno)rrrrrrrs

zStackTreeItem.get_stackcCs@tj}tj}t|d�r|j}t|�}|dk	r<|dt|�}|S)N�__name__z: )r�	last_type�
last_value�hasattrr$�str)r�type�value�srrrr's
zStackTreeItem.get_exceptioncCs|jS)N)r)rrrr�GetText1szStackTreeItem.GetTextcCs.g}x$|jD]}t||j�}|j|�qW|S)N)r�
FrameTreeItemrr")r�sublist�inforrrr�
GetSubList4s
zStackTreeItem.GetSubList)NN)r$�
__module__�__qualname__rrrr,r0rrrrrs


rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r-cCs||_||_dS)N)r/r)rr/rrrrr>szFrameTreeItem.__init__c	Cs||j\}}y|jd}Wnd}YnX|j}|j}|j}tj||�}|j�}|dkrhd|||f}nd||||f}|S)Nr$�?�z%s, line %d: %sz%s.%s(...), line %d: %s)r3r4N)r/�	f_globals�f_code�co_filename�co_name�	linecache�getline�strip)	rr
�lineno�modname�code�filename�funcnameZ
sourcelinerrrrr,Bs


zFrameTreeItem.GetTextcCsR|j\}}g}|j|jk	r4td|j|j�}|j|�td|j|j�}|j|�|S)Nz<locals>z	<globals>)r/r5�f_locals�VariablesTreeItemrr")rr
r<r.rrrrr0Ts


zFrameTreeItem.GetSubListcCs6|jr2|j\}}|jj}tjj|�r2|jj||�dS)N)rr/r6r7�os�path�isfileZgotofileline)rr
r<r?rrr�
OnDoubleClick^s

zFrameTreeItem.OnDoubleClickN)r$r1r2rr,r0rFrrrrr-<s
r-c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rBcCs|jS)N)Z	labeltext)rrrrr,hszVariablesTreeItem.GetTextcCsdS)Nr)rrrr�GetLabelTextkszVariablesTreeItem.GetLabelTextcCst|j�dkS)Nr)�len�object)rrrr�IsExpandablenszVariablesTreeItem.IsExpandablec
Cslg}xb|jj�D]T}y|j|}Wntk
r8wYnX||jfdd�}t|d||�}|j|�qW|S)NcSs|||<dS)Nr)r*�keyrIrrr�setfunctionxsz1VariablesTreeItem.GetSubList.<locals>.setfunctionz =)rI�keys�KeyErrorrr")rr.rKr*rLrrrrr0qszVariablesTreeItem.GetSubListN)r$r1r2r,rGrJr0rrrrrBfsrBc	Cs�ddlm}tj|�}|jd�tt|j�jd�dd��\}}|jd|d|df�||�}yt	Wn"t
k
r�tj�\}}}YnX|t_
|t_|t_t||||d	�t`
t`t`dS)
Nr)�PyShellFileListzTest StackViewer�+rz+%d+%d�2�)rrr)Zidlelib.pyshellrOrr�title�map�intZgeometry�splitZintentional_name_error�	NameErrorr�exc_infor%r&rr)	�parentrOr�x�yr�exc_type�	exc_valueZexc_tbrrr�
_stack_viewers"

 r^�__main__)�mainz"idlelib.idle_test.test_stackviewer�F)�	verbosity�exit)�run)NNN)r9rCrZtkinterrZidlelib.debugobjrrZidlelib.treerrrrrr-rBr^r$Zunittestr`Zidlelib.idle_test.htestrdrrrr�<module>s
'*

?>