diff options
author | Guido van Rossum <guido@python.org> | 1999-01-02 21:28:54 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-01-02 21:28:54 (GMT) |
commit | 504b0bf066e4fddb21646331e89c2f6836c5c638 (patch) | |
tree | f5454648430eb4818810305325561aabb02cf035 /Tools/idle/StackViewer.py | |
parent | f07c328c072e62ada8671ec30392572add22d904 (diff) | |
download | cpython-504b0bf066e4fddb21646331e89c2f6836c5c638.zip cpython-504b0bf066e4fddb21646331e89c2f6836c5c638.tar.gz cpython-504b0bf066e4fddb21646331e89c2f6836c5c638.tar.bz2 |
Checking in IDLE 0.2.
Much has changed -- too much, in fact, to write down.
The big news is that there's a standard way to write IDLE extensions;
see extend.txt. Some sample extensions have been provided, and
some existing code has been converted to extensions. Probably the
biggest new user feature is a new search dialog with more options,
search and replace, and even search in files (grep).
This is exactly as downloaded from my laptop after returning
from the holidays -- it hasn't even been tested on Unix yet.
Diffstat (limited to 'Tools/idle/StackViewer.py')
-rw-r--r-- | Tools/idle/StackViewer.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Tools/idle/StackViewer.py b/Tools/idle/StackViewer.py index 688c1b4..93923f9 100644 --- a/Tools/idle/StackViewer.py +++ b/Tools/idle/StackViewer.py @@ -4,16 +4,18 @@ import os from Tkinter import * import linecache from repr import Repr +from WindowList import ListedToplevel from ScrolledList import ScrolledList class StackBrowser: - + def __init__(self, root, flist, stack=None): - self.top = top = Toplevel(root) + self.top = top = ListedToplevel(root) top.protocol("WM_DELETE_WINDOW", self.close) top.wm_title("Stack viewer") + top.wm_iconname("Stack") # Create help label self.helplabel = Label(top, text="Click once to view variables; twice for source", @@ -24,7 +26,7 @@ class StackBrowser: if stack is None: stack = get_stack() self.sv.load_stack(stack) - + def close(self): self.top.destroy() @@ -44,7 +46,7 @@ class StackBrowser: self.show_globals(frame) self.show_locals(frame) self.curframe = frame - + def show_globals(self, frame): title = "Global Variables" if frame.f_globals.has_key("__name__"): @@ -66,7 +68,7 @@ class StackBrowser: title, self.globalsdict) self.globalsframe.pack(fill="both", side="bottom") - + def show_locals(self, frame): self.localsdict = None if self.localsviewer: @@ -92,7 +94,7 @@ class StackBrowser: class StackViewer(ScrolledList): - + def __init__(self, master, flist, browser): ScrolledList.__init__(self, master) self.flist = flist @@ -149,7 +151,7 @@ class StackViewer(ScrolledList): def show_stack_frame(self): index = self.listbox.index("active") self.browser.show_frame(self.stack[index]) - + def show_source(self, index): frame, lineno = self.stack[index] code = frame.f_code @@ -169,7 +171,7 @@ def get_stack(t=None, f=None): while f is not None: stack.append((f, f.f_lineno)) if f is self.botframe: - break + break f = f.f_back stack.reverse() while t is not None: @@ -191,7 +193,7 @@ def getexception(type=None, value=None): class NamespaceViewer: - + def __init__(self, master, title, dict=None): width = 0 height = 40 @@ -217,9 +219,9 @@ class NamespaceViewer: self.subframe = subframe = Frame(canvas) self.sfid = canvas.create_window(0, 0, window=subframe, anchor="nw") self.load_dict(dict) - + dict = -1 - + def load_dict(self, dict, force=0): if dict is self.dict and not force: return |