From 623c80c03c934b2b66b65ac50672a147e7fedf4b Mon Sep 17 00:00:00 2001 From: noahhaasis Date: Sat, 21 Jul 2018 19:03:58 +0200 Subject: [PATCH 1/5] bpo-34154: Fix the docstring of the Listbox class. --- Lib/tkinter/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index b78191e2777f450..e02c3447fcca882 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -2767,11 +2767,11 @@ class Listbox(Widget, XView, YView): def __init__(self, master=None, cnf={}, **kw): """Construct a listbox widget with the parent MASTER. - Valid resource names: background, bd, bg, borderwidth, cursor, - exportselection, fg, font, foreground, height, highlightbackground, - highlightcolor, highlightthickness, relief, selectbackground, - selectborderwidth, selectforeground, selectmode, setgrid, takefocus, - width, xscrollcommand, yscrollcommand, listvariable.""" + Valid resource names: activestyle, background, bd, bg, borderwidth, + cursor, disabledforeground, exportselection, fg, font, foreground, height, + highlightbackground, highlightcolor, highlightthickness, listvariable, + relief, selectbackground, selectborderwidth, selectforeground, selectmode, + setgrid, state, takefocus, width, xscrollcommand, yscrollcommand.""" Widget.__init__(self, master, 'listbox', cnf, kw) def activate(self, index): """Activate item identified by INDEX.""" From 8f5aeb3f73c243a818c562bd261e076de2ca21cb Mon Sep 17 00:00:00 2001 From: noahhaasis Date: Sun, 22 Jul 2018 05:39:35 +0200 Subject: [PATCH 2/5] Remove the trailing whitespace --- Lib/tkinter/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index e02c3447fcca882..4799a992bc8cb66 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -2767,10 +2767,10 @@ class Listbox(Widget, XView, YView): def __init__(self, master=None, cnf={}, **kw): """Construct a listbox widget with the parent MASTER. - Valid resource names: activestyle, background, bd, bg, borderwidth, - cursor, disabledforeground, exportselection, fg, font, foreground, height, - highlightbackground, highlightcolor, highlightthickness, listvariable, - relief, selectbackground, selectborderwidth, selectforeground, selectmode, + Valid resource names: activestyle, background, bd, bg, borderwidth, + cursor, disabledforeground, exportselection, fg, font, foreground, height, + highlightbackground, highlightcolor, highlightthickness, listvariable, + relief, selectbackground, selectborderwidth, selectforeground, selectmode, setgrid, state, takefocus, width, xscrollcommand, yscrollcommand.""" Widget.__init__(self, master, 'listbox', cnf, kw) def activate(self, index): From af08fab9e07d66d61a5097dd63aa615b6b85fedb Mon Sep 17 00:00:00 2001 From: noahhaasis Date: Mon, 23 Jul 2018 11:15:39 +0200 Subject: [PATCH 3/5] Add missing keyword arguments to the docs. Added missing keywordarguments for following classes: TopLevel, Checkbutton, Entry, Frame, Label, Radiobutton, Text, Spinbox --- Lib/tkinter/__init__.py | 67 +++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 4799a992bc8cb66..3cb58ccfdc38db2 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -2321,8 +2321,8 @@ def __init__(self, master=None, cnf={}, **kw): Valid resource names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, - highlightcolor, highlightthickness, menu, relief, screen, takefocus, - use, visual, width.""" + highlightcolor, highlightthickness, menu, padx, pady, relief, + screen, takefocus, use, visual, width.""" if kw: cnf = _cnfmerge((cnf, kw)) extra = () @@ -2634,12 +2634,13 @@ def __init__(self, master=None, cnf={}, **kw): """Construct a checkbutton widget with the parent MASTER. Valid resource names: activebackground, activeforeground, anchor, - background, bd, bg, bitmap, borderwidth, command, cursor, + background, bd, bg, bitmap, borderwidth, command, compound, cursor, disabledforeground, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, image, - indicatoron, justify, offvalue, onvalue, padx, pady, relief, - selectcolor, selectimage, state, takefocus, text, textvariable, - underline, variable, width, wraplength.""" + indicatoron, justify, offrelief, offvalue, onvalue, overrelief, + padx, pady, relief, selectcolor, selectimage, state, takefocus, + text, textvariable, tristateimage, tristatevalue, underline, + variable, width, wraplength.""" Widget.__init__(self, master, 'checkbutton', cnf, kw) def deselect(self): """Put the button in off-state.""" @@ -2663,10 +2664,11 @@ def __init__(self, master=None, cnf={}, **kw): """Construct an entry widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, - exportselection, fg, font, foreground, highlightbackground, - highlightcolor, highlightthickness, insertbackground, - insertborderwidth, insertofftime, insertontime, insertwidth, - invalidcommand, invcmd, justify, relief, selectbackground, + disabledbackground, disabledforeground, exportselection, + fg, font, foreground, highlightbackground, highlightcolor, + highlightthickness, insertbackground, insertborderwidth, + insertofftime, insertontime, insertwidth, invalidcommand, + invcmd, justify, readonlybackground, relief, selectbackground, selectborderwidth, selectforeground, show, state, takefocus, textvariable, validate, validatecommand, vcmd, width, xscrollcommand.""" @@ -2728,8 +2730,8 @@ def __init__(self, master=None, cnf={}, **kw): """Construct a frame widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, class, - colormap, container, cursor, height, highlightbackground, - highlightcolor, highlightthickness, relief, takefocus, visual, width.""" + colormap, container, cursor, height, highlightbackground, highlightcolor, + highlightthickness, padx, pady, relief, takefocus, visual, width.""" cnf = _cnfmerge((cnf, kw)) extra = () if 'class_' in cnf: @@ -2748,8 +2750,8 @@ def __init__(self, master=None, cnf={}, **kw): STANDARD OPTIONS activebackground, activeforeground, anchor, - background, bitmap, borderwidth, cursor, - disabledforeground, font, foreground, + background, bitmap, borderwidth, compound, + cursor, disabledforeground, font, foreground, highlightbackground, highlightcolor, highlightthickness, image, justify, padx, pady, relief, takefocus, text, @@ -2769,9 +2771,10 @@ def __init__(self, master=None, cnf={}, **kw): Valid resource names: activestyle, background, bd, bg, borderwidth, cursor, disabledforeground, exportselection, fg, font, foreground, height, - highlightbackground, highlightcolor, highlightthickness, listvariable, - relief, selectbackground, selectborderwidth, selectforeground, selectmode, - setgrid, state, takefocus, width, xscrollcommand, yscrollcommand.""" + highlightbackground, highlightcolor, highlightthickness, justify, + listvariable, relief, selectbackground, selectborderwidth, selectforeground, + selectmode, setgrid, state, takefocus, width, xscrollcommand, + yscrollcommand.""" Widget.__init__(self, master, 'listbox', cnf, kw) def activate(self, index): """Activate item identified by INDEX.""" @@ -2972,12 +2975,12 @@ def __init__(self, master=None, cnf={}, **kw): """Construct a radiobutton widget with the parent MASTER. Valid resource names: activebackground, activeforeground, anchor, - background, bd, bg, bitmap, borderwidth, command, cursor, - disabledforeground, fg, font, foreground, height, - highlightbackground, highlightcolor, highlightthickness, image, - indicatoron, justify, padx, pady, relief, selectcolor, selectimage, - state, takefocus, text, textvariable, underline, value, variable, - width, wraplength.""" + background, bd, bg, bitmap, borderwidth, command, compound, cursor, + disabledforeground, fg, font, foreground, height, highlightbackground, + highlightcolor, highlightthickness, image, indicatoron, justify, + offrelief, overrelief, padx, pady, relief, selectcolor, selectimage, + state, takefocus, text, textvariable, tristateimage, tristatevalue, + underline, value, variable, width, wraplength.""" Widget.__init__(self, master, 'radiobutton', cnf, kw) def deselect(self): """Put the button in off-state.""" @@ -3077,15 +3080,15 @@ def __init__(self, master=None, cnf={}, **kw): STANDARD OPTIONS - background, borderwidth, cursor, - exportselection, font, foreground, - highlightbackground, highlightcolor, - highlightthickness, insertbackground, - insertborderwidth, insertofftime, - insertontime, insertwidth, padx, pady, - relief, selectbackground, + background, blockcursor, borderwidth, + cursor, endine, exportselection, font, + foreground, highlightbackground, highlightcolor, + highlightthickness, inactiveselectbackground, + insertbackground, insertborderwidth, + insertofftime, insertontime, insertunfocused, + insertwidth, padx, pady, relief, selectbackground, selectborderwidth, selectforeground, - setgrid, takefocus, + setgrid, startline, tabstyle, takefocus, xscrollcommand, yscrollcommand, WIDGET-SPECIFIC OPTIONS @@ -3637,7 +3640,7 @@ def __init__(self, master=None, cnf={}, **kw): disabledforeground, format, from, invalidcommand, increment, readonlybackground, state, to, - validate, validatecommand values, + validate, validatecommand, values, width, wrap, """ Widget.__init__(self, master, 'spinbox', cnf, kw) From 430b2077d4af21d9dbdea8d86b7996a0ea1270a9 Mon Sep 17 00:00:00 2001 From: noahhaasis Date: Mon, 23 Jul 2018 14:37:12 +0200 Subject: [PATCH 4/5] Remove trailing whitespace --- Lib/tkinter/__init__.py | 4 ++-- Lib/tkinter/test/test_tkinter/test_widgets.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 3cb58ccfdc38db2..97f8d36b0c1e8ff 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -3081,10 +3081,10 @@ def __init__(self, master=None, cnf={}, **kw): STANDARD OPTIONS background, blockcursor, borderwidth, - cursor, endine, exportselection, font, + cursor, endine, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, inactiveselectbackground, - insertbackground, insertborderwidth, + insertbackground, insertborderwidth, insertofftime, insertontime, insertunfocused, insertwidth, padx, pady, relief, selectbackground, selectborderwidth, selectforeground, diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index 81b52eafea9a83a..c4a17e754ebff4f 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -483,7 +483,7 @@ class TextTest(AbstractWidgetTest, unittest.TestCase): 'font', 'foreground', 'height', 'highlightbackground', 'highlightcolor', 'highlightthickness', 'inactiveselectbackground', 'insertbackground', 'insertborderwidth', - 'insertofftime', 'insertontime', 'insertunfocussed', 'insertwidth', + 'insertofftime', 'insertontime', 'insertunfocused', 'insertwidth', 'maxundo', 'padx', 'pady', 'relief', 'selectbackground', 'selectborderwidth', 'selectforeground', 'setgrid', 'spacing1', 'spacing2', 'spacing3', 'startline', 'state', From 2ff71c56234312debfd94c50b6808941723b91fd Mon Sep 17 00:00:00 2001 From: noahhaasis Date: Tue, 24 Jul 2018 07:31:49 +0200 Subject: [PATCH 5/5] Put typo back in to make the tests pass --- Lib/tkinter/test/test_tkinter/test_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index c4a17e754ebff4f..81b52eafea9a83a 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -483,7 +483,7 @@ class TextTest(AbstractWidgetTest, unittest.TestCase): 'font', 'foreground', 'height', 'highlightbackground', 'highlightcolor', 'highlightthickness', 'inactiveselectbackground', 'insertbackground', 'insertborderwidth', - 'insertofftime', 'insertontime', 'insertunfocused', 'insertwidth', + 'insertofftime', 'insertontime', 'insertunfocussed', 'insertwidth', 'maxundo', 'padx', 'pady', 'relief', 'selectbackground', 'selectborderwidth', 'selectforeground', 'setgrid', 'spacing1', 'spacing2', 'spacing3', 'startline', 'state',