[;@sdZddlZddlmZmZmZddljZddZ GdddZ dd Z d d Z d d Z edkrddlZejdddddndS)z'Define SearchEngine for search dialogs.N) StringVar BooleanVarTclErrorcCs(t|ds!t||_n|jS)zReturn the singleton SearchEngine instance for the process. The single SearchEngine saves settings between dialog instances. If there is not a SearchEngine already, make one. _searchengine)hasattr SearchEnginer)rootr */usr/lib/python3.4/idlelib/SearchEngine.pygetsr c@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZd#ddZddddZddd Zdd!d"ZdS)$rzspan)r,rBr.rCfoundijr r r rEs  rEc Csry"|jd}|jd}Wntk r@d}}YnX|sY|jd}n|sh|}n||fS)zFReturn tuple of 'line.col' indexes from selection or insert mark. z sel.firstzsel.lastNinsert)rFr)r6r9r:r r r r2s  r2cCs(tt|jd\}}||fS)z8Return (line, col) tuple of ints from 'line.col' string.rD)rGrHrI)rFr<r.r r r r3sr3__main__z#idlelib.idle_test.test_searchengine verbosityr"exitF)rNrZtkinterrrrZtkinter.messageboxZ messageboxr1r rrEr2r3rKZunittestmainr r r r s