mirror of
https://github.com/python/cpython.git
synced 2025-12-01 07:19:24 +00:00
bpo-33904: In IDLE's rstrip, rename class RstripExtension as Rstrip (GH-7811)
This commit is contained in:
parent
9af1836664
commit
9bb92235f6
4 changed files with 6 additions and 5 deletions
|
|
@ -58,7 +58,7 @@ class EditorWindow(object):
|
||||||
from idlelib.codecontext import CodeContext
|
from idlelib.codecontext import CodeContext
|
||||||
from idlelib.paragraph import FormatParagraph
|
from idlelib.paragraph import FormatParagraph
|
||||||
from idlelib.parenmatch import ParenMatch
|
from idlelib.parenmatch import ParenMatch
|
||||||
from idlelib.rstrip import RstripExtension
|
from idlelib.rstrip import Rstrip
|
||||||
from idlelib.zoomheight import ZoomHeight
|
from idlelib.zoomheight import ZoomHeight
|
||||||
|
|
||||||
filesystemencoding = sys.getfilesystemencoding() # for file names
|
filesystemencoding = sys.getfilesystemencoding() # for file names
|
||||||
|
|
@ -310,7 +310,7 @@ class EditorWindow(object):
|
||||||
scriptbinding = ScriptBinding(self)
|
scriptbinding = ScriptBinding(self)
|
||||||
text.bind("<<check-module>>", scriptbinding.check_module_event)
|
text.bind("<<check-module>>", scriptbinding.check_module_event)
|
||||||
text.bind("<<run-module>>", scriptbinding.run_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)
|
ctip = self.Calltip(self)
|
||||||
text.bind("<<try-open-calltip>>", ctip.try_open_calltip_event)
|
text.bind("<<try-open-calltip>>", ctip.try_open_calltip_event)
|
||||||
#refresh-calltip must come after paren-closed to work right
|
#refresh-calltip must come after paren-closed to work right
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ class rstripTest(unittest.TestCase):
|
||||||
def test_rstrip_line(self):
|
def test_rstrip_line(self):
|
||||||
editor = Editor()
|
editor = Editor()
|
||||||
text = editor.text
|
text = editor.text
|
||||||
do_rstrip = rstrip.RstripExtension(editor).do_rstrip
|
do_rstrip = rstrip.Rstrip(editor).do_rstrip
|
||||||
|
|
||||||
do_rstrip()
|
do_rstrip()
|
||||||
self.assertEqual(text.get('1.0', 'insert'), '')
|
self.assertEqual(text.get('1.0', 'insert'), '')
|
||||||
|
|
@ -27,7 +27,7 @@ class rstripTest(unittest.TestCase):
|
||||||
#from tkinter import Tk
|
#from tkinter import Tk
|
||||||
#editor = Editor(root=Tk())
|
#editor = Editor(root=Tk())
|
||||||
text = editor.text
|
text = editor.text
|
||||||
do_rstrip = rstrip.RstripExtension(editor).do_rstrip
|
do_rstrip = rstrip.Rstrip(editor).do_rstrip
|
||||||
|
|
||||||
original = (
|
original = (
|
||||||
"Line with an ending tab \n"
|
"Line with an ending tab \n"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'Provides "Strip trailing whitespace" under the "Format" menu.'
|
'Provides "Strip trailing whitespace" under the "Format" menu.'
|
||||||
|
|
||||||
class RstripExtension:
|
class Rstrip:
|
||||||
|
|
||||||
def __init__(self, editwin):
|
def __init__(self, editwin):
|
||||||
self.editwin = editwin
|
self.editwin = editwin
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
IDLE: In rstrip, rename class RstripExtension as Rstrip
|
||||||
Loading…
Add table
Add a link
Reference in a new issue