• File: ClassBrowser.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyc
  • Date Modified: 10/26/2026 8:10 PM
  • File size: 9.66 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

jc@sdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
dadddYZd	e
fd
YZde
fdYZd
e
fdYZdZedkrddlmZeendS(sClass browser.

XXX TO DO:

- reparse when source changed (maybe just a button would be OK?)
    (or recheck on window popup)
- add popup menu with more options (e.g. doc strings, base classes, imports)
- show function argument list? (have to do pattern matching on source)
- should the classes and methods lists also be in the module's menu bar?
- add base classes to class browser tree
iN(tPyShell(tListedToplevel(tTreeNodetTreeItemtScrolledCanvas(tidleConftClassBrowsercBs;eZedZddZdZdZdZRS(cCs[|stjjan||_tjj|d|jd|_||_	|j
|dS(sH
        _htest - bool, change box when location running htest.
        is.pyN(Rtflisttopent	file_opentnametostpathtjointfilet_htesttinit(tselfRR
RR((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyt__init__s	#	cCs|jj|jjdS(N(ttoptdestroytnode(Rtevent((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pytclose)s
cCs8||_tjjt|j|_}|jd|j|j	d|j|j
r|jd|jj|jj
dfn|j|jtj}tj|dd}t|d|dd	d
d}|jjddd
d|j}t|jd||_}|j|jdS(NtWM_DELETE_WINDOWs<Escape>s+%d+%ditnormalt
backgroundtbgthighlightthicknessit	takefocusitexpandtfilltboth(Rtpyclbrt_modulestclearRtrootRtprotocolRtbindRtgeometrytwinfo_rootxtwinfo_rootytsettitlet	focus_setRtCurrentThemetGetHighlightRtframetpacktrootnodeRtcanvastNoneRtupdateR(RRRtthemeRtsctitemR((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR-s$	
		'


cCs+|jjd|j|jjddS(NsClass Browser - s
Class Browser(Rtwm_titleR
twm_iconname(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR*DscCs
t|jS(N(tModuleBrowserTreeItemR(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR0HsN(	t__name__t
__module__tFalseRR2RRR*R0(((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRs
		R9cBsGeZdZdZdZdZdZdZdZRS(cCs
||_dS(N(R(RR((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRMscCstjj|jS(N(RRtbasenameR(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pytGetTextPscCsdS(Ntpython((R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pytGetIconNameSscCsFg}x9|jD]+}t||j|j}|j|qW|S(N(tlistclassestClassBrowserTreeItemtclassesRtappend(RtsublistR
R6((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyt
GetSubListVs
cCsStjj|jddkr#dStjj|js<dStjj|jdS(Nis.py(RRtnormcaseRtexistsRRR(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyt
OnDoubleClick]s
cCstjj|jddkS(Nis.py(RRRGR(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pytIsExpandabledscCstjj|j\}}tjj|\}}tjj|dkrOgSy tj||gtj}Wnt	k
rgSXg}i|_
x|jD]\}}|j|kr|}	t
|drl|jrlg}
xp|jD]e}t|tdkr|}n1|j}|j|jkrAd|j|f}n|
j|qW|	ddj|
}	n|j|j|	f||j
|	<qqW|jg}
x!|D]\}}	|
j|	qW|
S(Ns.pytsuperts%s.%ss(%s)s, (RRtsplitRtsplitextRGR!t
readmodule_extsystImportErrorRCtitemstmodulethasattrRKttypeR
RDR
tlinenotsort(RtdirRR
texttdictRRtkeytcltstsuperstsuptsnametlistR6((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRAgs< 
			
(	R:R;RR>R@RFRIRJRA(((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR9Ks						RBcBsGeZdZdZdZdZdZdZdZRS(cCsq||_||_||_y|j|j|_Wn ttfk
rTd|_nXt|jtj	|_
dS(N(R
RCRR\t
IndexErrortKeyErrorR2t
isinstanceR!tFunctiont
isfunction(RR
RCR((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRs			
cCs'|jrd|jdSd|jSdS(Nsdef s(...)sclass (RfR
(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR>s	cCs|jr
dSdSdS(NR?tfolder(Rf(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR@s	cCs5|jr1y|jjSWq1tk
r-tSXndS(N(R\tmethodstAttributeErrorR<(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRJs
	
cCsS|js
gSg}x9|jD]+}t||j|j}|j|q W|S(N(R\tlistmethodstMethodBrowserTreeItemRRD(RRER
R6((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRFs	cCsZtjj|jsdSt|j}t|jdrV|jj}|j|ndS(NRV(	RRRHRR	RTR\RVtgotoline(RteditRV((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRIscCs|js
gSg}x3|jjjD]\}}|j||fq&W|jg}x!|D]\}}|j|q`W|S(N(R\RhRRRDRW(RRRR
RVRaR6((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRjs	
(	R:R;RR>R@RJRFRIRj(((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRBs	
						RkcBs5eZdZdZdZdZdZRS(cCs||_||_||_dS(N(R
R\R(RR
R\R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRs		cCsd|jdS(Nsdef s(...)(R
(R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR>scCsdS(NR?((R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyR@scCsdS(Ni((R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRJscCsFtjj|jsdSt|j}|j|jj|jdS(N(	RRRHRR	RlR\RhR
(RRm((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRIs(R:R;RR>R@RJRI(((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyRks
				cCsy
t}WnHtk
rTtjd}tjdrDtjd}qUtjd}nXtjj|\}}tjj|d}tj	|}|j
at|||gdt
dS(NiiR(t__file__t	NameErrorRPtargvRRRMRNRtPyShellFileListRR	RtTrue(tparentRRXR
R((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyt_class_browsers



	t__main__(trun((t__doc__RRPR!tidlelibRtidlelib.WindowListRtidlelib.TreeWidgetRRRtidlelib.configHandlerRR2R	RR9RBRkRtR:tidlelib.idle_test.htestRv(((s9/opt/alt/python27/lib64/python2.7/idlelib/ClassBrowser.pyt<module>s 2=<