From 3e21ce9e5f2f102123f8dea80640d31639827129 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Wed, 20 Jun 2018 11:00:29 +0530 Subject: [PATCH 1/2] IDLE: In rstrip, rename class RstripExtension as Rstrip Signed-off-by: Srinivas Reddy Thatiparthy --- Lib/idlelib/editor.py | 4 ++-- Lib/idlelib/idle_test/test_rstrip.py | 4 ++-- Lib/idlelib/rstrip.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index f5a091860ec618..b46316569d05b5 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -58,7 +58,7 @@ class EditorWindow(object): from idlelib.codecontext import CodeContext from idlelib.paragraph import FormatParagraph from idlelib.parenmatch import ParenMatch - from idlelib.rstrip import RstripExtension + from idlelib.rstrip import Rstrip from idlelib.zoomheight import ZoomHeight filesystemencoding = sys.getfilesystemencoding() # for file names @@ -310,7 +310,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None): scriptbinding = ScriptBinding(self) text.bind("<>", scriptbinding.check_module_event) text.bind("<>", scriptbinding.run_module_event) - text.bind("<>", self.RstripExtension(self).do_rstrip) + text.bind("<>", self.Rstrip(self).do_rstrip) ctip = self.Calltip(self) text.bind("<>", ctip.try_open_calltip_event) #refresh-calltip must come after paren-closed to work right diff --git a/Lib/idlelib/idle_test/test_rstrip.py b/Lib/idlelib/idle_test/test_rstrip.py index 9ef1320eefbad5..2bc7c6f035e96b 100644 --- a/Lib/idlelib/idle_test/test_rstrip.py +++ b/Lib/idlelib/idle_test/test_rstrip.py @@ -9,7 +9,7 @@ class rstripTest(unittest.TestCase): def test_rstrip_line(self): editor = Editor() text = editor.text - do_rstrip = rstrip.RstripExtension(editor).do_rstrip + do_rstrip = rstrip.Rstrip(editor).do_rstrip do_rstrip() self.assertEqual(text.get('1.0', 'insert'), '') @@ -27,7 +27,7 @@ def test_rstrip_multiple(self): #from tkinter import Tk #editor = Editor(root=Tk()) text = editor.text - do_rstrip = rstrip.RstripExtension(editor).do_rstrip + do_rstrip = rstrip.Rstrip(editor).do_rstrip original = ( "Line with an ending tab \n" diff --git a/Lib/idlelib/rstrip.py b/Lib/idlelib/rstrip.py index b845d809d315ac..f93b5e8fc20021 100644 --- a/Lib/idlelib/rstrip.py +++ b/Lib/idlelib/rstrip.py @@ -1,6 +1,6 @@ 'Provides "Strip trailing whitespace" under the "Format" menu.' -class RstripExtension: +class Rstrip: def __init__(self, editwin): self.editwin = editwin From 81dc36c6c9dc73e8b6b86cb3c9bad2d00dd4e847 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Wed, 20 Jun 2018 12:42:41 +0530 Subject: [PATCH 2/2] Add News entry Signed-off-by: Srinivas Reddy Thatiparthy --- Misc/NEWS.d/next/IDLE/2018-06-20-12-40-54.bpo-33904.qm0eCu.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/IDLE/2018-06-20-12-40-54.bpo-33904.qm0eCu.rst diff --git a/Misc/NEWS.d/next/IDLE/2018-06-20-12-40-54.bpo-33904.qm0eCu.rst b/Misc/NEWS.d/next/IDLE/2018-06-20-12-40-54.bpo-33904.qm0eCu.rst new file mode 100644 index 00000000000000..efed2379b4bfa1 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-06-20-12-40-54.bpo-33904.qm0eCu.rst @@ -0,0 +1 @@ +IDLE: In rstrip, rename class RstripExtension as Rstrip