\ddZddlmZddlmZdZGddZeedkrddl Z e j d d d dSdS) zExample extension, also used for testing. See extend.txt for more details on creating an extension. See config-extension.def for configuring an extension. )idleConfwrapsc>tdfd }|S)z9Apply a formatting function to all of the selected lines.Nc|j\}}}}tt|dz D]}||}||||<|j||||dS)Nbreak) formatter get_regionrangelen set_region) selfeventheadtailcharslinesposline format_lines ..\python\lib\idlelib\zzdummy.pyapplyzformat_selection..applys#'>#<#<#>#> dE5Ua(( 1 1C:D$T400E#JJ !!$eU;;;w)Nr)rrs` rformat_selectionr s= ; LrcheZdZdZdddgfgZdZedZedZ edZ d S) ZzDummyz3Prepend or remove initial text from selected lines.format)zZ inz<>)zZ outz <>cD||_|j|_|j|_dS)z+Initialize the settings for this extension.N)editwintextfregionr )rr s r__init__zZzDummy.__init__%s L  rc<tjddd|_dS)z!Load class variables from config. extensionsrzz-textN)r GetOptionztext)clss rreloadzZzDummy.reload+s&|YII rc|j|S)zInsert text at the beginning of each selected line. This is bound to the <> virtual event when the extensions are loaded. )r')rrs r z_in_eventzZzDummy.z_in_event0s*$d$$$rcv||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) startswithr'r )rrzlengths r z_out_eventzZzDummy.z_out_event9s6 ??4:66K!!C OOGHH~rN) __name__ __module__ __qualname____doc__menudefsr# classmethodr)rr+r/rrrrs==  "  H))) JJ[J%%%rr__main__Nzidlelib.idle_test.test_zzdummyF) verbosityexit) r3idlelib.configr functoolsrrrr)r0unittestmainr6rrr?s $#####   ''''''''T zOOOHM2aeLLLLLLr