Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
idlelib.ClassBrowser.ModuleBrowserTreeItem Class Reference
Inheritance diagram for idlelib.ClassBrowser.ModuleBrowserTreeItem:
Inheritance graph
[legend]
Collaboration diagram for idlelib.ClassBrowser.ModuleBrowserTreeItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def GetText
def GetIconName
def GetSubList
def OnDoubleClick
def IsExpandable
def listclasses
def GetLabelText
def IsEditable
def SetText
def GetSelectedIconName

Public Attributes

 file
 classes

Static Public Attributes

 expandable = None

Detailed Description

Definition at line 62 of file ClassBrowser.py.


Constructor & Destructor Documentation

Definition at line 64 of file ClassBrowser.py.

00064 
00065     def __init__(self, file):
00066         self.file = file

Here is the caller graph for this function:


Member Function Documentation

Return name of icon to be displayed normally.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 70 of file ClassBrowser.py.

00070 
00071     def GetIconName(self):
00072         return "python"

def idlelib.TreeWidget.TreeItem.GetLabelText (   self) [inherited]
Return label text string to display in front of text (if any).

Reimplemented in idlelib.StackViewer.VariablesTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 319 of file TreeWidget.py.

00319 
00320     def GetLabelText(self):
00321         """Return label text string to display in front of text (if any)."""

Return name of icon to be displayed when selected.

Definition at line 352 of file TreeWidget.py.

00352 
00353     def GetSelectedIconName(self):
00354         """Return name of icon to be displayed when selected."""

Return list of items forming sublist.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 73 of file ClassBrowser.py.

00073 
00074     def GetSubList(self):
00075         sublist = []
00076         for name in self.listclasses():
00077             item = ClassBrowserTreeItem(name, self.classes, self.file)
00078             sublist.append(item)
00079         return sublist

Here is the call graph for this function:

Here is the caller graph for this function:

Return text string to display.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 67 of file ClassBrowser.py.

00067 
00068     def GetText(self):
00069         return os.path.basename(self.file)

def idlelib.TreeWidget.TreeItem.IsEditable (   self) [inherited]
Return whether the item's text may be edited.

Reimplemented in idlelib.TreeWidget.FileTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 343 of file TreeWidget.py.

00343 
00344     def IsEditable(self):
00345         """Return whether the item's text may be edited."""

Return whether there are subitems.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 87 of file ClassBrowser.py.

00087 
00088     def IsExpandable(self):
00089         return os.path.normcase(self.file[-3:]) == ".py"

Here is the caller graph for this function:

Definition at line 90 of file ClassBrowser.py.

00090 
00091     def listclasses(self):
00092         dir, file = os.path.split(self.file)
00093         name, ext = os.path.splitext(file)
00094         if os.path.normcase(ext) != ".py":
00095             return []
00096         try:
00097             dict = pyclbr.readmodule_ex(name, [dir] + sys.path)
00098         except ImportError as msg:
00099             return []
00100         items = []
00101         self.classes = {}
00102         for key, cl in dict.items():
00103             if cl.module == name:
00104                 s = key
00105                 if hasattr(cl, 'super') and cl.super:
00106                     supers = []
00107                     for sup in cl.super:
00108                         if type(sup) is type(''):
00109                             sname = sup
00110                         else:
00111                             sname = sup.name
00112                             if sup.module != cl.module:
00113                                 sname = "%s.%s" % (sup.module, sname)
00114                         supers.append(sname)
00115                     s = s + "(%s)" % ", ".join(supers)
00116                 items.append((cl.lineno, s))
00117                 self.classes[s] = cl
00118         items.sort()
00119         list = []
00120         for item, s in items:
00121             list.append(s)
00122         return list

Here is the call graph for this function:

Here is the caller graph for this function:

Called on a double-click on the item.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 80 of file ClassBrowser.py.

00080 
00081     def OnDoubleClick(self):
00082         if os.path.normcase(self.file[-3:]) != ".py":
00083             return
00084         if not os.path.exists(self.file):
00085             return
00086         PyShell.flist.open(self.file)

def idlelib.TreeWidget.TreeItem.SetText (   self,
  text 
) [inherited]
Change the item's text (if it is editable).

Reimplemented in idlelib.TreeWidget.FileTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 346 of file TreeWidget.py.

00346 
00347     def SetText(self, text):
00348         """Change the item's text (if it is editable)."""


Member Data Documentation

Definition at line 100 of file ClassBrowser.py.

idlelib.TreeWidget.TreeItem.expandable = None [static, inherited]
Do not override!  Called by TreeNode.

Definition at line 322 of file TreeWidget.py.

Definition at line 65 of file ClassBrowser.py.


The documentation for this class was generated from the following file: