Back to index

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

List of all members.

Public Member Functions

def __init__
def GetText
def GetSubList
def ispackagedir
def listmodules
def GetLabelText
def IsExpandable
def IsEditable
def SetText
def GetIconName
def GetSelectedIconName
def OnDoubleClick

Public Attributes

 dir
 packages

Static Public Attributes

 expandable = None

Detailed Description

Definition at line 32 of file PathBrowser.py.


Constructor & Destructor Documentation

def idlelib.PathBrowser.DirBrowserTreeItem.__init__ (   self,
  dir,
  packages = [] 
)

Definition at line 34 of file PathBrowser.py.

00034 
00035     def __init__(self, dir, packages=[]):
00036         self.dir = dir
00037         self.packages = packages

Here is the caller graph for this function:


Member Function Documentation

def idlelib.TreeWidget.TreeItem.GetIconName (   self) [inherited]
Return name of icon to be displayed normally.

Reimplemented in idlelib.TreeWidget.FileTreeItem, idlelib.ClassBrowser.MethodBrowserTreeItem, idlelib.ClassBrowser.ClassBrowserTreeItem, idlelib.ClassBrowser.ModuleBrowserTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 349 of file TreeWidget.py.

00349 
00350     def GetIconName(self):
00351         """Return name of icon to be displayed normally."""

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 44 of file PathBrowser.py.

00044 
00045     def GetSubList(self):
00046         try:
00047             names = os.listdir(self.dir or os.curdir)
00048         except os.error:
00049             return []
00050         packages = []
00051         for name in names:
00052             file = os.path.join(self.dir, name)
00053             if self.ispackagedir(file):
00054                 nn = os.path.normcase(name)
00055                 packages.append((nn, name, file))
00056         packages.sort()
00057         sublist = []
00058         for nn, name, file in packages:
00059             item = DirBrowserTreeItem(file, self.packages + [name])
00060             sublist.append(item)
00061         for nn, name in self.listmodules(names):
00062             item = ModuleBrowserTreeItem(os.path.join(self.dir, name))
00063             sublist.append(item)
00064         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 38 of file PathBrowser.py.

00038 
00039     def GetText(self):
00040         if not self.packages:
00041             return self.dir
00042         else:
00043             return self.packages[-1] + ": package"

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."""

def idlelib.TreeWidget.TreeItem.IsExpandable (   self) [inherited]

Definition at line 65 of file PathBrowser.py.

00065 
00066     def ispackagedir(self, file):
00067         if not os.path.isdir(file):
00068             return 0
00069         init = os.path.join(file, "__init__.py")
00070         return os.path.exists(init)

Here is the caller graph for this function:

Definition at line 71 of file PathBrowser.py.

00071 
00072     def listmodules(self, allnames):
00073         modules = {}
00074         suffixes = imp.get_suffixes()
00075         sorted = []
00076         for suff, mode, flag in suffixes:
00077             i = -len(suff)
00078             for name in allnames[:]:
00079                 normed_name = os.path.normcase(name)
00080                 if normed_name[i:] == suff:
00081                     mod_name = name[:i]
00082                     if mod_name not in modules:
00083                         modules[mod_name] = None
00084                         sorted.append((normed_name, name))
00085                         allnames.remove(name)
00086         sorted.sort()
00087         return sorted

Here is the caller graph for this function:

def idlelib.TreeWidget.TreeItem.OnDoubleClick (   self) [inherited]
Called on a double-click on the item.

Reimplemented in idlelib.ClassBrowser.MethodBrowserTreeItem, idlelib.ClassBrowser.ClassBrowserTreeItem, idlelib.StackViewer.FrameTreeItem, and idlelib.ClassBrowser.ModuleBrowserTreeItem.

Definition at line 358 of file TreeWidget.py.

00358 
00359     def OnDoubleClick(self):
00360         """Called on a double-click on the item."""
00361 
00362 
00363 # Example application

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 35 of file PathBrowser.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 36 of file PathBrowser.py.


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