diff options
author | Guido van Rossum <guido@python.org> | 1992-01-27 17:00:10 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-01-27 17:00:10 (GMT) |
commit | 19a86e72df72ff8e0b3a6f0d97b233bd22b70b7d (patch) | |
tree | e97d75dc068b2709a116b60a435356d1b97cde0d | |
parent | fac6da22ff19cff2c39d0a571442242898ae70d6 (diff) | |
download | cpython-19a86e72df72ff8e0b3a6f0d97b233bd22b70b7d.zip cpython-19a86e72df72ff8e0b3a6f0d97b233bd22b70b7d.tar.gz cpython-19a86e72df72ff8e0b3a6f0d97b233bd22b70b7d.tar.bz2 |
Added MINHEIGHT. Use self.dict as environment for evaluation.
-rw-r--r-- | Lib/lib-stdwin/wdbframewin.py | 14 | ||||
-rwxr-xr-x | Lib/stdwin/wdbframewin.py | 14 |
2 files changed, 22 insertions, 6 deletions
diff --git a/Lib/lib-stdwin/wdbframewin.py b/Lib/lib-stdwin/wdbframewin.py index 422baa2..9e21365 100644 --- a/Lib/lib-stdwin/wdbframewin.py +++ b/Lib/lib-stdwin/wdbframewin.py @@ -1,4 +1,10 @@ -# wdb.py -- a window-based Python debugger +# wdbframewin.py -- frame window for wdb.py + +# XXX To do: +# - display function name in window title +# - execute arbitrary statements instead of just evaluating expressions +# - allow setting variables by editing their values + import stdwin from stdwinevents import * @@ -6,6 +12,7 @@ import basewin import sys WIDTH = 40 +MINHEIGHT = 8 MAXHEIGHT = 16 class FrameWindow(basewin.BaseWindow): @@ -15,12 +22,13 @@ class FrameWindow(basewin.BaseWindow): self.frame = frame # Not used except for identity tests self.dict = dict self.name = name - nl = max(4, len(self.dict)) + nl = max(MINHEIGHT, len(self.dict) + 5) nl = min(nl, MAXHEIGHT) width = WIDTH*stdwin.textwidth('0') height = nl*stdwin.lineheight() stdwin.setdefwinsize(width, height) self = basewin.BaseWindow.init(self, '--Frame ' + name + '--') + # XXX Should use current function name self.initeditor() self.displaylist = ['>>>', '', '-'*WIDTH] self.refreshframe() @@ -60,7 +68,7 @@ class FrameWindow(basewin.BaseWindow): output = '' else: globals = self.frame.f_globals - locals = self.frame.f_locals + locals = self.dict try: value = eval(expr, globals, locals) output = repr.repr(value) diff --git a/Lib/stdwin/wdbframewin.py b/Lib/stdwin/wdbframewin.py index 422baa2..9e21365 100755 --- a/Lib/stdwin/wdbframewin.py +++ b/Lib/stdwin/wdbframewin.py @@ -1,4 +1,10 @@ -# wdb.py -- a window-based Python debugger +# wdbframewin.py -- frame window for wdb.py + +# XXX To do: +# - display function name in window title +# - execute arbitrary statements instead of just evaluating expressions +# - allow setting variables by editing their values + import stdwin from stdwinevents import * @@ -6,6 +12,7 @@ import basewin import sys WIDTH = 40 +MINHEIGHT = 8 MAXHEIGHT = 16 class FrameWindow(basewin.BaseWindow): @@ -15,12 +22,13 @@ class FrameWindow(basewin.BaseWindow): self.frame = frame # Not used except for identity tests self.dict = dict self.name = name - nl = max(4, len(self.dict)) + nl = max(MINHEIGHT, len(self.dict) + 5) nl = min(nl, MAXHEIGHT) width = WIDTH*stdwin.textwidth('0') height = nl*stdwin.lineheight() stdwin.setdefwinsize(width, height) self = basewin.BaseWindow.init(self, '--Frame ' + name + '--') + # XXX Should use current function name self.initeditor() self.displaylist = ['>>>', '', '-'*WIDTH] self.refreshframe() @@ -60,7 +68,7 @@ class FrameWindow(basewin.BaseWindow): output = '' else: globals = self.frame.f_globals - locals = self.frame.f_locals + locals = self.dict try: value = eval(expr, globals, locals) output = repr.repr(value) |