ó
|Nc           @   s#   d  Z  d Z d d d     YZ d S(   s=   Provides "Strip trailing whitespace" under the "Format" menu.s)   Roger D. Serwy <roger.serwy at gmail.com>t   RstripExtensionc           B   s2   e  Z d  d d g f g Z d   Z d d  Z RS(   t   formats   Strip trailing whitespaces   <<do-rstrip>>c         C   s&   | |  _  |  j  j j d |  j  d  S(   Ns   <<do-rstrip>>(   t   editwint   textt   bindt	   do_rstrip(   t   selfR   (    (    s,   C:\RCS\Python\lib\idlelib\RstripExtension.pyt   __init__   s    	c         C   sł   |  j  j } |  j  j } | j   t t | j d    d } xa t d |  D]P } | j d | d |  } t	 | j
    } | j d | | f d |  qQ W| j   d  S(   Nt   endi   s   %i.0s   %i.0 lineends   %i.%i(   R   R   t   undot   undo_block_startt   intt   floatt   indext   ranget   gett   lent   rstript   deletet   undo_block_stop(   R   t   eventR   R	   t   end_linet   curt   txtt   cut(    (    s,   C:\RCS\Python\lib\idlelib\RstripExtension.pyR      s    
"N(   s   Strip trailing whitespaces   <<do-rstrip>>(   t   __name__t
   __module__t   Nonet   menudefsR   R   (    (    (    s,   C:\RCS\Python\lib\idlelib\RstripExtension.pyR       s   	N(    (   t   __doc__t
   __author__R    (    (    (    s,   C:\RCS\Python\lib\idlelib\RstripExtension.pyt   <module>   s   