diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 22:48:03 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 22:48:03 (GMT) |
commit | 62012fc719818b6087b01c93fcc1cd0d2b4d8932 (patch) | |
tree | 5104802fce85d89b4f2d186d38ec0b579f486237 /Lib/idlelib/ObjectBrowser.py | |
parent | d383bafa556de686be4898d6544ce998a0812532 (diff) | |
download | cpython-62012fc719818b6087b01c93fcc1cd0d2b4d8932.zip cpython-62012fc719818b6087b01c93fcc1cd0d2b4d8932.tar.gz cpython-62012fc719818b6087b01c93fcc1cd0d2b4d8932.tar.bz2 |
Issue #21477: Idle htest: merge and modify run and runall; add many tests.
Patch by Saimadhav Heblikar
Diffstat (limited to 'Lib/idlelib/ObjectBrowser.py')
-rw-r--r-- | Lib/idlelib/ObjectBrowser.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/ObjectBrowser.py index 7de6988..acc5248 100644 --- a/Lib/idlelib/ObjectBrowser.py +++ b/Lib/idlelib/ObjectBrowser.py @@ -9,6 +9,8 @@ # XXX TO DO: # - for classes/modules, add "open source" to object browser +import re + from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas from repr import Repr @@ -132,12 +134,13 @@ def make_objecttreeitem(labeltext, object, setfunction=None): c = ObjectTreeItem return c(labeltext, object, setfunction) -# Test script -def _test(): +def _object_browser(parent): import sys from Tkinter import Tk root = Tk() + width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) + root.geometry("+%d+%d"%(x, y + 100)) root.configure(bd=0, bg="yellow") root.focus_set() sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1) @@ -148,4 +151,5 @@ def _test(): root.mainloop() if __name__ == '__main__': - _test() + from idlelib.idle_test.htest import run + run(_object_browser) |