From 2e43b64c94e49f7133b9c26e84c9519935c49063 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Wed, 22 Jan 2020 20:54:30 -0700 Subject: [PATCH] bpo-39050: The Help button in IDLE's config menu works again (GH-17611) Co-authored-by: Terry Jan Reedy --- Lib/idlelib/NEWS.txt | 2 ++ Lib/idlelib/configdialog.py | 2 +- Lib/idlelib/idle_test/test_configdialog.py | 11 +++++++++++ .../IDLE/2020-01-22-22-28-06.bpo-39050.zkn0FO.rst | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/IDLE/2020-01-22-22-28-06.bpo-39050.zkn0FO.rst diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 9f8894e517b..69bf5603068 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,8 @@ Released on 2020-10-05? ====================================== +bpo-39050: Make Settings dialog Help button work again. + bpo-32989: Add tests for editor newline_and_indent_event method. Remove dead code from pyparse find_good_parse_start method. diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index aaf319bbe1b..0e007b516ea 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -210,7 +210,7 @@ class ConfigDialog(Toplevel): """ page = self.note.tab(self.note.select(), option='text').strip() view_text(self, title='Help for IDLE preferences', - text=help_common+help_pages.get(page, '')) + contents=help_common+help_pages.get(page, '')) def deactivate_current_config(self): """Remove current key bindings. diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index 1f14ed1f264..7c575d0e599 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -47,6 +47,17 @@ def tearDownModule(): root.destroy() root = dialog = None +class ConfigDialogTest(unittest.TestCase): + + def test_help(self): + dialog.note.select(dialog.keyspage) + saved = configdialog.view_text + view = configdialog.view_text = Func() + dialog.help() + s = view.kwds['contents'] + self.assertTrue(s.startswith('When you click')) + self.assertTrue(s.endswith('a different name.\n')) + configdialog.view_text = saved class FontPageTest(unittest.TestCase): """Test that font widgets enable users to make font changes. diff --git a/Misc/NEWS.d/next/IDLE/2020-01-22-22-28-06.bpo-39050.zkn0FO.rst b/Misc/NEWS.d/next/IDLE/2020-01-22-22-28-06.bpo-39050.zkn0FO.rst new file mode 100644 index 00000000000..e71265cdf10 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2020-01-22-22-28-06.bpo-39050.zkn0FO.rst @@ -0,0 +1 @@ +Make IDLE Settings dialog Help button work again.