
   j9gE qb                       S r SSKJr  SSKJr  S r " S S5      r\R                  5         \S:X  a  SSK	r	\	R                  " S	S
SS9  gg)zExample extension, also used for testing.

See extend.txt for more details on creating an extension.
See config-extension.def for configuring an extension.
    )idleConfwrapsc                 4   ^  [        T 5      SU 4S jj5       nU$ )z9Apply a formatting function to all of the selected lines.c                    > U R                   R                  5       u  p#pE[        [        U5      S-
  5       H  nXV   nT" X5      XV'   M     U R                   R	                  X#XE5        g)N   break)	formatter
get_regionrangelen
set_region)	selfeventheadtailcharslinesposlineformat_lines	           &/usr/lib/python3.13/idlelib/zzdummy.pyapplyformat_selection.<locals>.apply   s]    #'>>#<#<#> EUa(C:D$T0EJ ) 	!!$e;    )Nr   )r   r   s   ` r   format_selectionr      s#     ;  Lr   c                   \    \ rS rSrSrSSS/4/rS r\S 5       r\	S 5       r
\	S	 5       rS
rg)ZzDummy   z3Prepend or remove initial text from selected lines.format)zZ inz<<z-in>>)zZ outz	<<z-out>>c                 T    Xl         UR                  U l        UR                  U l        g)z+Initialize the settings for this extension.N)editwintextfregionr
   )r   r"   s     r   __init__ZzDummy.__init__%   s    LL	 r   c                 >    [         R                  " SSS5      U l        g)z!Load class variables from config.
extensionsr   zz-textN)r   	GetOptionztext)clss    r   reloadZzDummy.reload+   s     &&|YI	r   c                 "    U R                    U 3$ )zInsert text at the beginning of each selected line.

This is bound to the <<z-in>> virtual event when the extensions
are loaded.
)r*   )r   r   s     r   
z_in_eventZzDummy.z_in_event0   s     **dV$$r   c                 x    UR                  U R                  5      (       d  SO[        U R                  5      nXS $ )zRemove specific text from the beginning of each selected line.

This is bound to the <<z-out>> virtual event when the extensions
are loaded.
r   N)
startswithr*   r   )r   r   zlengths      r   z_out_eventZzDummy.z_out_event9   s/      ??4::66!C

OH~r   )r"   r
   r#   N)__name__
__module____qualname____firstlineno____doc__menudefsr%   classmethodr,   r   r/   r4   __static_attributes__ r   r   r   r      sd    = 
 "
 	H) J J % %  r   r   __main__Nzidlelib.idle_test.test_zzdummy   F)	verbosityexit)r:   idlelib.configr   	functoolsr   r   r   r,   r6   unittestmainr>   r   r   <module>rG      sQ    $ ' 'T   zMM2aeL r   