o =?h@sbdZddlmZddlmZddZGdddZeedkr/dd l Z e j d d d d d Sd 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. )idleConfwrapscstdfdd }|S)z9Apply a formatting function to all of the selected lines.NcsT|j\}}}}tt|dD] }||}||||<q|j||||dS)Nbreak) formatterZ get_regionrangelenZ set_region)selfZeventheadtailcharslinesposline format_line6/opt/alt/python310/lib64/python3.10/idlelib/zzdummy.pyapplys zformat_selection..apply)Nr)rrrrrformat_selection src@sJeZdZdZdddgfgZddZeddZed d Z ed d Z d S)ZzDummyz3Prepend or remove initial text from selected lines.format)zZ inz<>)zZ outz <>cCs||_|j|_|j|_dS)z+Initialize the settings for this extension.N)editwintextZfregionr)r rrrr__init__%s zZzDummy.__init__cCstddd|_dS)z!Load class variables from config. extensionsrzz-textN)rZ GetOptionztext)clsrrrreload+szZzDummy.reloadcCs|j|S)zInsert text at the beginning of each selected line. This is bound to the <> virtual event when the extensions are loaded. )r)r rrrr z_in_event0szZzDummy.z_in_eventcCs&||jsdnt|j}||dS)zRemove specific text from the beginning of each selected line. This is bound to the <> virtual event when the extensions are loaded. rN) startswithrr )r rZzlengthrrr z_out_event9s zZzDummy.z_out_eventN) __name__ __module__ __qualname____doc__Zmenudefsr classmethodrrr r"rrrrrs  r__main__Nzidlelib.idle_test.test_zzdummyF) verbosityexit) r&Zidlelib.configr functoolsrrrrr#Zunittestmainrrrrs  *