diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 22:48:18 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 22:48:18 (GMT) |
commit | 1b392ffe67febbe8740520289bb828fdf060e363 (patch) | |
tree | 27d5496ec5479afd9d1a36efcd02614315e7c447 /Lib/idlelib/ObjectBrowser.py | |
parent | 10cbb1e463378391d2368874bb31af0447fa73e6 (diff) | |
download | cpython-1b392ffe67febbe8740520289bb828fdf060e363.zip cpython-1b392ffe67febbe8740520289bb828fdf060e363.tar.gz cpython-1b392ffe67febbe8740520289bb828fdf060e363.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 b359efc..0f3c1bc 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 reprlib import Repr @@ -119,12 +121,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) @@ -135,4 +138,5 @@ def _test(): root.mainloop() if __name__ == '__main__': - _test() + from idlelib.idle_test.htest import run + run(_object_browser) |