cpython: 72a8a107eed1 (original) (raw)

Mercurial > cpython

changeset 90867:72a8a107eed1 2.7

Issue #21477: Idle htest: modify run; add more tests. Patch by Saimadhav Heblikar. 2.7 backport of 90829, d7eea8f608c2. [#21477]

Terry Jan Reedy tjreedy@udel.edu
date Tue, 27 May 2014 02:47:38 -0400
parents be77b213ace0
children e770d8c4291c
files Lib/idlelib/ClassBrowser.py Lib/idlelib/ColorDelegator.py Lib/idlelib/EditorWindow.py Lib/idlelib/PathBrowser.py Lib/idlelib/Percolator.py Lib/idlelib/StackViewer.py Lib/idlelib/ToolTip.py Lib/idlelib/idle_test/htest.py Lib/idlelib/keybindingDialog.py
diffstat 9 files changed, 158 insertions(+), 96 deletions(-)[+] [-] Lib/idlelib/ClassBrowser.py 2 Lib/idlelib/ColorDelegator.py 8 Lib/idlelib/EditorWindow.py 10 Lib/idlelib/PathBrowser.py 2 Lib/idlelib/Percolator.py 50 Lib/idlelib/StackViewer.py 39 Lib/idlelib/ToolTip.py 5 Lib/idlelib/idle_test/htest.py 112 Lib/idlelib/keybindingDialog.py 26

line wrap: on

line diff

--- a/Lib/idlelib/ClassBrowser.py +++ b/Lib/idlelib/ClassBrowser.py @@ -13,7 +13,6 @@ XXX TO DO: import os import sys import pyclbr -import re from idlelib import PyShell from idlelib.WindowList import ListedToplevel @@ -223,6 +222,7 @@ def _class_browser(parent): #Wrapper for name = os.path.splitext(file)[0] flist = PyShell.PyShellFileList(parent) ClassBrowser(flist, name, [dir], _htest=True)

if name == "main": from idlelib.idle_test.htest import run

--- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -261,13 +261,9 @@ def _color_delegator(parent): root.title("Test ColorDelegator") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) root.geometry("+%d+%d"%(x, y + 150)) -## with open(file, 'r') as f: -## source = f.read()

-## text.insert("insert", source[:690])

--- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -1714,18 +1714,16 @@ def fixwordbreaks(root): def _editor_window(parent): root = parent fixwordbreaks(root) -## root.withdraw() if sys.argv[1:]: filename = sys.argv[1] else: filename = None macosxSupport.setupApp(root, None) edit = EditorWindow(root=root, filename=filename) -## edit.set_close_hook(root.quit) -## edit.text.bind("<>", edit.close_event)

+ if name == 'main': from idlelib.idle_test.htest import run

--- a/Lib/idlelib/PathBrowser.py +++ b/Lib/idlelib/PathBrowser.py @@ -1,6 +1,5 @@ import os import sys -import re import imp from idlelib.TreeWidget import TreeItem @@ -95,6 +94,7 @@ class DirBrowserTreeItem(TreeItem): def _path_browser(parent): flist = PyShellFileList(parent) PathBrowser(flist, _htest=True)

if name == "main": from unittest import main

--- a/Lib/idlelib/Percolator.py +++ b/Lib/idlelib/Percolator.py @@ -52,7 +52,9 @@ class Percolator: filter.setdelegate(None) -def main(): +def _percolator(parent):

@@ -63,23 +65,39 @@ def main(): def delete(self, *args): print self.name, ": delete", args self.delegate.delete(*args)

+

+

+

if name == "main":

--- a/Lib/idlelib/StackViewer.py +++ b/Lib/idlelib/StackViewer.py @@ -1,9 +1,12 @@ import os import sys import linecache +import re +import Tkinter as tk from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem +from idlelib.PyShell import PyShellFileList def StackBrowser(root, flist=None, tb=None, top=None): if top is None: @@ -121,17 +124,29 @@ class VariablesTreeItem(ObjectTreeItem): sublist.append(item) return sublist - -def _test():

+def _stack_viewer(parent):

+

+

-if name == "main":

+ +if name == 'main':

--- a/Lib/idlelib/ToolTip.py +++ b/Lib/idlelib/ToolTip.py @@ -87,8 +87,9 @@ def _tooltip(parent): button2 = Button(root, text="Button 2") button1.pack() button2.pack()

--- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -40,7 +40,7 @@ AboutDialog_spec = { }, 'msg': "Test every button. Ensure Python, TK and IDLE versions " "are correctly displayed.\n [Close] to exit.",

_calltip_window_spec = { 'file': 'CallTipWindow', @@ -53,9 +53,10 @@ AboutDialog_spec = { 'file': 'ClassBrowser', 'kwds': {}, 'msg': "Inspect names of module, class(with superclass if "

_color_delegator_spec = { 'file': 'ColorDelegator', @@ -74,11 +75,11 @@ AboutDialog_spec = { "Select one of the many options in the 'new option set'." } -#_editor_window_spec = { -# 'file': 'EditorWindow', -# 'kwds': {}, -# 'msg': "Test editor functions of interest" -# } +_editor_window_spec = {

GetCfgSectionNameDialog_spec = { 'file': 'configSectionNameDialog', @@ -91,6 +92,7 @@ GetCfgSectionNameDialog_spec = { "Close 'Get Name' with a valid entry (printed to Shell), " "[Cancel], or [X]", } + GetHelpSourceDialog_spec = { 'file': 'configHelpSourceEdit', 'kwds': {'title': 'Get helpsource', @@ -103,10 +105,27 @@ GetHelpSourceDialog_spec = { "[Cancel] will print None to shell", } +# Update once issue21519 is resolved. +GetKeysDialog_spec = {

+ _help_dialog_spec = { 'file': 'EditorWindow', 'kwds': {},

- } _multi_call_spec = { 'file': 'MultiCall', 'kwds': {},

+ +_percolator_spec = {

+ +_stack_viewer_spec = {

@@ -198,29 +236,27 @@ TextViewer_spec = { _widget_redirector_spec = { 'file': 'WidgetRedirector', 'kwds': {},

help_string = [tk.StringVar('')] test_name = [tk.StringVar('')] @@ -231,11 +267,11 @@ def run(test=None): def next(): if len(test_list) == 1: next_button.pack_forget()

- def run_test(): widget = callable_object0

--- a/Lib/idlelib/keybindingDialog.py +++ b/Lib/idlelib/keybindingDialog.py @@ -7,12 +7,13 @@ import string import sys class GetKeysDialog(Toplevel):

@@ -38,11 +39,14 @@ class GetKeysDialog(Toplevel): self.LoadFinalKeyList() self.withdraw() #hide while setting geometry self.update_idletasks()

@@ -258,11 +262,5 @@ class GetKeysDialog(Toplevel): return keysOK if name == 'main':