diff options
author | Guido van Rossum <guido@python.org> | 1998-10-14 03:43:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-14 03:43:05 (GMT) |
commit | 35e55da7dce202b985b1735b9ae9b0080a993ba4 (patch) | |
tree | fef9652ddaf35547eae088d23b6dbb3ddccd32c8 /Tools/idle/PyShell.py | |
parent | fc6aba5008caede94ad65a9cf387b3ba971d5379 (diff) | |
download | cpython-35e55da7dce202b985b1735b9ae9b0080a993ba4.zip cpython-35e55da7dce202b985b1735b9ae9b0080a993ba4.tar.gz cpython-35e55da7dce202b985b1735b9ae9b0080a993ba4.tar.bz2 |
Polish the Debugger GUI a bit.
Closing it now also does the right thing.
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r-- | Tools/idle/PyShell.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index 4cabc3e..a794def 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -252,19 +252,27 @@ class PyShell(PyShellEditorWindow): return "break" db = self.interp.getdebugger() if db: + self.close_debugger() + else: + self.open_debugger() + + def close_debugger(self): + db = self.interp.getdebugger() + if db: + self.interp.setdebugger(None) db.close() self.resetoutput() self.console.write("[DEBUG OFF]\n") sys.ps1 = ">>> " self.showprompt() - self.interp.setdebugger(None) - else: - import Debugger - self.interp.setdebugger(Debugger.Debugger(self)) - sys.ps1 = "[DEBUG ON]>>> " - self.showprompt() - self.top.tkraise() - self.text.focus_set() + + def open_debugger(self): + import Debugger + self.interp.setdebugger(Debugger.Debugger(self)) + sys.ps1 = "[DEBUG ON]>>> " + self.showprompt() + self.top.tkraise() + self.text.focus_set() def beginexecuting(self): # Helper for ModifiedInterpreter |