diff options
author | Guido van Rossum <guido@python.org> | 1998-10-16 16:12:11 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-16 16:12:11 (GMT) |
commit | 80d132deda37640fb9029d32cde4a5aa0a5e9876 (patch) | |
tree | e9ea84ec0d8eb51a83c2331c0d6dc825f66e83df /Tools/idle/PyShell.py | |
parent | 92a67d7847089c2da37be841f38b6939302c6ebd (diff) | |
download | cpython-80d132deda37640fb9029d32cde4a5aa0a5e9876.zip cpython-80d132deda37640fb9029d32cde4a5aa0a5e9876.tar.gz cpython-80d132deda37640fb9029d32cde4a5aa0a5e9876.tar.bz2 |
Better debugger support (show stack etc).
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r-- | Tools/idle/PyShell.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index a794def..c81b666 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -3,6 +3,7 @@ import os import sys import string +import getopt import re import linecache @@ -552,8 +553,8 @@ class PyShell(PyShellEditorWindow): "(sys.last_traceback is not defined)", master=self.text) return - from StackViewer import StackViewer - sv = StackViewer(self.root, self.flist) + from StackViewer import StackBrowser + sv = StackBrowser(self.root, self.flist) def showprompt(self): self.resetoutput() @@ -599,17 +600,28 @@ class PseudoFile: def main(): + debug = 0 + try: + opts, args = getopt.getopt(sys.argv[1:], "d") + except getopt.error, msg: + sys.stderr.write("Error: %s\n" % str(msg)) + sys.exit(2) + for o, a in opts: + if o == "-d": + debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) - if sys.argv[1:]: + if args: for filename in sys.argv[1:]: flist.open(filename) t = PyShell(flist) flist.pyshell = t t.begin() + if debug: + t.open_debugger() root.mainloop() if __name__ == "__main__": |