
    d                         d Z ddlmZ ddlmZ d Z G d d          Ze                                 edk    rddl	Z	 e	j
        d	d
d           dS dS )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                 >     t                     d fd	            }|S )z9Apply a formatting function to all of the selected lines.Nc                     | j                                         \  }}}}t          t          |          dz
            D ]}||         } | |          ||<   | j                             ||||           dS )N   break)	formatter
get_regionrangelen
set_region)	selfeventheadtailcharslinesposlineformat_lines	           !  /croot/python-split_1694437901252/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/idlelib/zzdummy.pyapplyzformat_selection.<locals>.apply   s    #'>#<#<#>#> dE5Ua(( 	1 	1C:D$T400E#JJ!!$eU;;;w    )Nr   )r   r   s   ` r   format_selectionr      s=     ;      Lr   c                   h    e Zd ZdZdddgfgZd Zed             Zed             Z	ed             Z
d	S )
ZzDummyz3Prepend or remove initial text from selected lines.format)zZ inz<<z-in>>)zZ outz	<<z-out>>c                 D    || _         |j        | _        |j        | _        dS )z+Initialize the settings for this extension.N)editwintextfregionr
   )r   r    s     r   __init__zZzDummy.__init__%   s    L	 r   c                 <    t          j        ddd          | _        dS )z!Load class variables from config.
extensionsr   zz-textN)r   	GetOptionztext)clss    r   reloadzZzDummy.reload+   s     &|YII			r   c                     | j          | S )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_eventzZzDummy.z_in_event0   s     *$d$$$r   c                 v    |                     | j                  sdnt          | j                  }||d         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_eventzZzDummy.z_out_event9   s6      ??4:66K!!C
OOGHH~r   N)__name__
__module____qualname____doc__menudefsr#   classmethodr)   r   r+   r/    r   r   r   r      s        == 
 "
 	H) ) ) J J [J % % %     r   r   __main__Nzidlelib.idle_test.test_zzdummy   F)	verbosityexit)r3   idlelib.configr   	functoolsr   r   r   r)   r0   unittestmainr6   r   r   <module>r?      s     $ # # # # #        ' ' ' ' ' ' ' 'T     zOOOHM2aeLLLLLL r   