summaryrefslogtreecommitdiff
path: root/lib/python2.7/idlelib/RstripExtension.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/idlelib/RstripExtension.py')
-rw-r--r--lib/python2.7/idlelib/RstripExtension.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/python2.7/idlelib/RstripExtension.py b/lib/python2.7/idlelib/RstripExtension.py
deleted file mode 100644
index 19e35d4..0000000
--- a/lib/python2.7/idlelib/RstripExtension.py
+++ /dev/null
@@ -1,29 +0,0 @@
-'Provides "Strip trailing whitespace" under the "Format" menu.'
-
-__author__ = "Roger D. Serwy <roger.serwy at gmail.com>"
-
-class RstripExtension:
-
- menudefs = [
- ('format', [None,
- ('Strip trailing whitespace', '<<do-rstrip>>'),
- ]),]
-
- def __init__(self, editwin):
- self.editwin = editwin
- self.editwin.text.bind("<<do-rstrip>>", self.do_rstrip)
-
- def do_rstrip(self, event=None):
-
- text = self.editwin.text
- undo = self.editwin.undo
-
- undo.undo_block_start()
-
- end_line = int(float(text.index('end'))) + 1
- for cur in range(1, end_line):
- txt = text.get('%i.0' % cur, '%i.0 lineend' % cur)
- cut = len(txt.rstrip())
- text.delete('%i.%i' % (cur, cut), '%i.0 lineend' % cur)
-
- undo.undo_block_stop()