Showing content from http://svn.python.org/projects/python/branches/test_subprocess_10826/Lib/idlelib/RstripExtension.py below:
'Provides "Strip trailing whitespace" under the "Format" menu.' __author__ = "Roger D. Serwy " class RstripExtension: menudefs = [ ('format', [None, ('Strip trailing whitespace', '< >'), ]),] def __init__(self, editwin): self.editwin = editwin self.editwin.text.bind("< >", 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()
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4