Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-33904: In IDLE's rstrip, rename class RstripExtension as Rstrip (G…
…H-7811)

(cherry picked from commit 9bb9223)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <srinivasreddy@users.noreply.github.com>
  • Loading branch information
srinivasreddy authored and miss-islington committed Jun 20, 2018
commit a6414cc9866f00a488a9680cb6bfdadf1b917cfd
4 changes: 2 additions & 2 deletions Lib/idlelib/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -310,7 +310,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
scriptbinding = ScriptBinding(self)
text.bind("<<check-module>>", scriptbinding.check_module_event)
text.bind("<<run-module>>", scriptbinding.run_module_event)
text.bind("<<do-rstrip>>", self.RstripExtension(self).do_rstrip)
text.bind("<<do-rstrip>>", self.Rstrip(self).do_rstrip)
ctip = self.Calltip(self)
text.bind("<<try-open-calltip>>", ctip.try_open_calltip_event)
#refresh-calltip must come after paren-closed to work right
Expand Down
4 changes: 2 additions & 2 deletions Lib/idlelib/idle_test/test_rstrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'), '')
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Lib/idlelib/rstrip.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'Provides "Strip trailing whitespace" under the "Format" menu.'

class RstripExtension:
class Rstrip:

def __init__(self, editwin):
self.editwin = editwin
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDLE: In rstrip, rename class RstripExtension as Rstrip