PATH:
opt
/
alt
/
python36
/
lib64
/
python3.6
/
idlelib
'Provides "Strip trailing whitespace" under the "Format" menu.' class Rstrip: def __init__(self, editwin): self.editwin = editwin 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'))) for cur in range(1, end_line): txt = text.get('%i.0' % cur, '%i.end' % cur) raw = len(txt) cut = len(txt.rstrip()) # Since text.delete() marks file as changed, even if not, # only call it when needed to actually delete something. if cut < raw: text.delete('%i.%i' % (cur, cut), '%i.end' % cur) undo.undo_block_stop() if __name__ == "__main__": from unittest import main main('idlelib.idle_test.test_rstrip', verbosity=2,)
[-] stackviewer.py
[edit]
[-] textview.py
[edit]
[-] calltip_w.py
[edit]
[-] config-main.def
[edit]
[+]
__pycache__
[-] grep.py
[edit]
[-] dynoption.py
[edit]
[-] __init__.py
[edit]
[-] debugobj.py
[edit]
[-] tooltip.py
[edit]
[-] idle.py
[edit]
[-] rpc.py
[edit]
[-] TODO.txt
[edit]
[-] parenmatch.py
[edit]
[-] outwin.py
[edit]
[-] config-extensions.def
[edit]
[-] NEWS2x.txt
[edit]
[-] history.py
[edit]
[-] searchengine.py
[edit]
[-] squeezer.py
[edit]
[-] mainmenu.py
[edit]
[-] percolator.py
[edit]
[-] browser.py
[edit]
[-] pathbrowser.py
[edit]
[-] pyshell.py
[edit]
[-] calltip.py
[edit]
[-] redirector.py
[edit]
[-] extend.txt
[edit]
[-] replace.py
[edit]
[-] config-highlight.def
[edit]
[-] autocomplete_w.py
[edit]
[-] HISTORY.txt
[edit]
[-] autocomplete.py
[edit]
[-] autoexpand.py
[edit]
[-] window.py
[edit]
[-] search.py
[edit]
[-] statusbar.py
[edit]
[+]
idle_test
[-] searchbase.py
[edit]
[-] query.py
[edit]
[-] configdialog.py
[edit]
[-] hyperparser.py
[edit]
[-] help_about.py
[edit]
[-] config.py
[edit]
[-] idle.pyw
[edit]
[-] run.py
[edit]
[-] config_key.py
[edit]
[-] config-keys.def
[edit]
[-] zoomheight.py
[edit]
[-] NEWS.txt
[edit]
[-] _pyclbr.py
[edit]
[-] iomenu.py
[edit]
[-] tree.py
[edit]
[-] help.py
[edit]
[-] filelist.py
[edit]
[-] pyparse.py
[edit]
[+]
..
[-] README.txt
[edit]
[-] debugger.py
[edit]
[-] editor.py
[edit]
[+]
Icons
[-] multicall.py
[edit]
[-] delegator.py
[edit]
[-] paragraph.py
[edit]
[-] help.html
[edit]
[-] runscript.py
[edit]
[-] zzdummy.py
[edit]
[-] ChangeLog
[edit]
[-] rstrip.py
[edit]
[-] colorizer.py
[edit]
[-] codecontext.py
[edit]
[-] macosx.py
[edit]
[-] CREDITS.txt
[edit]
[-] debugger_r.py
[edit]
[-] undo.py
[edit]
[-] scrolledlist.py
[edit]
[-] __main__.py
[edit]
[-] debugobj_r.py
[edit]