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/Debugger.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/Debugger.py')
-rw-r--r-- | Tools/idle/Debugger.py | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/Tools/idle/Debugger.py b/Tools/idle/Debugger.py index 7cb2fdb..24a7376 100644 --- a/Tools/idle/Debugger.py +++ b/Tools/idle/Debugger.py @@ -2,28 +2,29 @@ import os import bdb import traceback from Tkinter import * +from WindowList import ListedToplevel import StackViewer class Debugger(bdb.Bdb): - + interacting = 0 - + vstack = vsource = vlocals = vglobals = None - + def __init__(self, pyshell): bdb.Bdb.__init__(self) self.pyshell = pyshell self.make_gui() - + def close(self): if self.interacting: self.top.bell() return self.pyshell.close_debugger() self.top.destroy() - + def run(self, *args): try: self.interacting = 1 @@ -41,12 +42,14 @@ class Debugger(bdb.Bdb): def user_exception(self, frame, info): self.interaction(frame, info) - + def make_gui(self): pyshell = self.pyshell self.flist = pyshell.flist self.root = root = pyshell.root - self.top = top = Toplevel(root) + self.top = top =ListedToplevel(root) + self.top.wm_title("Debug Control") + self.top.wm_iconname("Debug") top.wm_protocol("WM_DELETE_WINDOW", self.close) # self.bframe = bframe = Frame(top) @@ -113,9 +116,9 @@ class Debugger(bdb.Bdb): self.show_locals() if self.vglobals.get(): self.show_globals() - + frame = None - + def interaction(self, frame, info=None): self.frame = frame code = frame.f_code @@ -167,7 +170,7 @@ class Debugger(bdb.Bdb): self.status.configure(text="") self.error.configure(text="", background=self.errorbg) self.frame = None - + def sync_source_line(self): frame = self.frame if not frame: @@ -179,19 +182,19 @@ class Debugger(bdb.Bdb): edit = self.flist.open(file) if edit: edit.gotoline(lineno) - + def cont(self): self.set_continue() self.root.quit() - + def step(self): self.set_step() self.root.quit() - + def next(self): self.set_next(self.frame) self.root.quit() - + def ret(self): self.set_return(self.frame) self.root.quit() @@ -211,7 +214,7 @@ class Debugger(bdb.Bdb): self.stackviewer = None sv.close() self.fstack['height'] = 1 - + def show_source(self): if self.vsource.get(): self.sync_source_line() @@ -277,16 +280,16 @@ class Debugger(bdb.Bdb): text.bell() return text.tag_add("BREAK", "insert linestart", "insert lineend +1char") - + # A literal copy of Bdb.set_break() without the print statement at the end def set_break(self, filename, lineno, temporary=0, cond = None): - import linecache # Import as late as possible - line = linecache.getline(filename, lineno) - if not line: - return 'That line does not exist!' - if not self.breaks.has_key(filename): - self.breaks[filename] = [] - list = self.breaks[filename] - if not lineno in list: - list.append(lineno) - bp = bdb.Breakpoint(filename, lineno, temporary, cond) + import linecache # Import as late as possible + line = linecache.getline(filename, lineno) + if not line: + return 'That line does not exist!' + if not self.breaks.has_key(filename): + self.breaks[filename] = [] + list = self.breaks[filename] + if not lineno in list: + list.append(lineno) + bp = bdb.Breakpoint(filename, lineno, temporary, cond) |