Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
idlelib.RstripExtension.RstripExtension Class Reference

List of all members.

Public Member Functions

def __init__
def do_rstrip

Public Attributes

 editwin

Static Public Attributes

list menudefs

Detailed Description

Definition at line 5 of file RstripExtension.py.


Constructor & Destructor Documentation

def idlelib.RstripExtension.RstripExtension.__init__ (   self,
  editwin 
)

Definition at line 12 of file RstripExtension.py.

00012 
00013     def __init__(self, editwin):
00014         self.editwin = editwin
00015         self.editwin.text.bind("<<do-rstrip>>", self.do_rstrip)

Here is the caller graph for this function:


Member Function Documentation

def idlelib.RstripExtension.RstripExtension.do_rstrip (   self,
  event = None 
)

Definition at line 16 of file RstripExtension.py.

00016 
00017     def do_rstrip(self, event=None):
00018 
00019         text = self.editwin.text
00020         undo = self.editwin.undo
00021 
00022         undo.undo_block_start()
00023 
00024         end_line = int(float(text.index('end'))) + 1
00025         for cur in range(1, end_line):
00026             txt = text.get('%i.0' % cur, '%i.0 lineend' % cur)
00027             cut = len(txt.rstrip())
00028             text.delete('%i.%i' % (cur, cut), '%i.0 lineend' % cur)
00029 
00030         undo.undo_block_stop()

Member Data Documentation

Definition at line 13 of file RstripExtension.py.

Initial value:
[
        ('format', [None,
               ('Strip trailing whitespace', '<<do-rstrip>>'),
       ]),]

Definition at line 7 of file RstripExtension.py.


The documentation for this class was generated from the following file: