JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr YfJ@s ddlZddlZddlZddlZddlZddlmZmZm Z ddl m Z m Z ddl mZdddddZGdddeZGd d d eZGd d d e Zd dZedkrddlmZeedS)N)TreeNodeTreeItemScrolledCanvas)ObjectTreeItemmake_objecttreeitem)PyShellFileListcCs~|dkrtj|}t|dddd}|jjddddt||}t|jd|}|jdS) NZbgZwhiteZhighlightthicknessrexpandZfillZboth) tkZToplevelrframeZpack StackTreeItemrZcanvasr)rootflisttbtopZscitemZnoder8/opt/alt/python35/lib64/python3.5/idlelib/StackViewer.py StackBrowser s rc@sReZdZddddZddZddZdd Zd d ZdS) r NcCs.||_|j||_|j|_dS)N)r get_stackstack get_exceptiontext)selfrrrrr__init__s zStackTreeItem.__init__cCsr|dkrtj}g}|r9|jdkr9|j}x2|dk rm|j|j|jf|j}q<W|S)N)syslast_tracebacktb_frametb_nextappend tb_lineno)rrrrrrrs    zStackTreeItem.get_stackcCsZtj}tj}t|dr*|j}t|}|dk rV|dt|}|S)N__name__z: )r last_type last_valuehasattrr!str)rtypevaluesrrrr&s     zStackTreeItem.get_exceptioncCs|jS)N)r)rrrrGetText0szStackTreeItem.GetTextcCs=g}x0|jD]%}t||j}|j|qW|S)N)r FrameTreeItemrr)rsublistinforrrr GetSubList3s zStackTreeItem.GetSubList)r! __module__ __qualname__rrrr)r-rrrrr s  r c@s@eZdZddZddZddZddZd S) r*cCs||_||_dS)N)r,r)rr,rrrrr<s zFrameTreeItem.__init__c Cs|j\}}y|jd}Wnd}YnX|j}|j}|j}tj||}|j}|dkrd|||f}nd||||f}|S)Nr!?z%s, line %d: %sz%s.%s(...), line %d: %s)r0r1N)r, f_globalsf_code co_filenameco_name linecachegetlinestrip) rr linenomodnamecodefilenamefuncnameZ sourcelinerrrrr)@s        zFrameTreeItem.GetTextcCsu|j\}}g}|j|jk rLtd|j|j}|j|td|j|j}|j||S)Nzz )r,r2f_localsVariablesTreeItemrr)rr r9r+rrrrr-Rs  zFrameTreeItem.GetSubListcCsM|jrI|j\}}|jj}tjj|rI|jj||dS)N)rr,r3r4ospathisfileZ gotofileline)rr r9r<rrr OnDoubleClick\s   zFrameTreeItem.OnDoubleClickN)r!r.r/rr)r-rCrrrrr*:s    r*c@sLeZdZddZddZddZddZd d Zd S) r?cCs|jS)N)Z labeltext)rrrrr)eszVariablesTreeItem.GetTextcCsdS)Nr)rrrr GetLabelTexthszVariablesTreeItem.GetLabelTextcCst|jdkS)Nr)lenobject)rrrr IsExpandablekszVariablesTreeItem.IsExpandablec Csg}xx|jjD]g}y|j|}Wntk rDwYnX||jdd}t|d||}|j|qW|S)NcSs|||.setfunctionz =)rFkeysKeyErrorrr)rr+rHr'rIrrrrr-ns zVariablesTreeItem.GetSubListcCst|jjS)N)listrFrJ)rrrrrJ{szVariablesTreeItem.keysN)r!r.r/r)rDrGr-rJrrrrr?cs     r?c Cstj}|jdttttjd|j\}}}}|jd||dft |}yt Wn't k rt j \}}} YnX|t _|t _| t _t|d|d|d| t `t `t `dS)NzTest StackViewerz[x+]z+%d+%drrr)r ZTktitlerLmapintresplitZgeometryrZintentional_name_error NameErrorrexc_infor"r#rr) parentr widthZheightxyrexc_type exc_valueZexc_tbrrr _stack_viewer~s   3     r[__main__)run)r@rr6rQZtkinterr Zidlelib.TreeWidgetrrrZidlelib.ObjectBrowserrrZidlelib.PyShellrrr r*r?r[r!Zidlelib.idle_test.htestr]rrrrs      &)