summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-10-13 16:32:44 (GMT)
committerGuido van Rossum <guido@python.org>1998-10-13 16:32:44 (GMT)
commit7895562f884baa2de4d14d56cfe9ad5e021c767e (patch)
treec77dd76e4d519424efb79ec260e9d1211a9b4150 /Tools
parentae08d3897ab467f656653ea1062f6fc54fed32e6 (diff)
downloadcpython-7895562f884baa2de4d14d56cfe9ad5e021c767e.zip
cpython-7895562f884baa2de4d14d56cfe9ad5e021c767e.tar.gz
cpython-7895562f884baa2de4d14d56cfe9ad5e021c767e.tar.bz2
Add class browser functionality.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/idle/FileList.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tools/idle/FileList.py b/Tools/idle/FileList.py
index f7a08e1..3895399 100644
--- a/Tools/idle/FileList.py
+++ b/Tools/idle/FileList.py
@@ -33,6 +33,7 @@ class MultiEditorWindow(EditorWindow):
self.io.edit = self
self.text.bind("<<open-new-window>>", self.flist.new_callback)
self.text.bind("<<close-all-windows>>", self.flist.close_all_callback)
+ self.text.bind("<<open-class-browser>>", self.open_class_browser)
def close_hook(self):
self.flist.close_edit(self)
@@ -60,6 +61,22 @@ class MultiEditorWindow(EditorWindow):
def openit(self=self, file=file):
self.flist.open(file)
wmenu.add_command(label=file, command=openit)
+
+ def open_class_browser(self, event=None):
+ filename = self.io.filename
+ if not filename:
+ tkMessageBox.showerror(
+ "No filename",
+ "This buffer has no associated filename",
+ master=self.text)
+ return None
+ head, tail = os.path.split(filename)
+ base, ext = os.path.splitext(tail)
+ import pyclbr
+ if pyclbr._modules.has_key(base):
+ del pyclbr._modules[base]
+ import ClassBrowser
+ ClassBrowser.ClassBrowser(self.flist, base)
class FileList: