]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added MINHEIGHT. Use self.dict as environment for evaluation.
authorGuido van Rossum <guido@python.org>
Mon, 27 Jan 1992 17:00:10 +0000 (17:00 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 27 Jan 1992 17:00:10 +0000 (17:00 +0000)
Lib/lib-stdwin/wdbframewin.py
Lib/stdwin/wdbframewin.py

index 422baa281497794bc920d5953358e398b07c9ac1..9e2136560c8a121b7069d4f8ac140160e762db33 100644 (file)
@@ -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)
index 422baa281497794bc920d5953358e398b07c9ac1..9e2136560c8a121b7069d4f8ac140160e762db33 100755 (executable)
@@ -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)