Ë ªá`¡­»ãóª—dZddlmZddlmZddlmZd„Zd„Zd„Z d„Z Gd „d e«Z d „Z e d k(r dd lmZeddd¬«ddlmZee «yy)z¨Search dialog for Find, Find Again, and Find Selection functionality. Inherits from SearchDialogBase for GUI and uses searchengine to prepare search pattern. é)ÚTclError)Ú searchengine)ÚSearchDialogBasecóž—|j«}tj|«}t|d«st ||«|_|j S)zÜReturn the new or existing singleton SearchDialog instance. The singleton dialog saves user entries and preferences across instances. Args: text: Text widget containing the text to be searched. Ú _searchdialog)Ú_rootrÚgetÚhasattrÚ SearchDialogr)ÚtextÚrootÚengines ú%/usr/lib/python3.12/idlelib/search.pyÚ_setupr sD€ð �:‰:‹<€DÜ × Ñ ˜dÓ #€FÜ �6˜?Ô +Ü+¨D°&Ó9ˆÔØ × Ñ Ðócó\—|jdd«}t|«j||«S)a Open the search dialog. Module-level function to access the singleton SearchDialog instance and open the dialog. If text is selected, it is used as the search phrase; otherwise, the previous entry is used. No search is done with this command. ú sel.firstúsel.last)r rÚopen)r Úpats rÚfindrs+€ð �(‰(�;  Ó +€CÜ �$‹<× Ñ ˜T 3Ó 'Ð'rcó6—t|«j|«S)aSRepeat the search for the last pattern and preferences. Module-level function to access the singleton SearchDialog instance to search again using the user entries and preferences from the last dialog. If there was no prior search, open the search dialog; otherwise, perform the search without showing the dialog. )rÚ find_again©r s rrr&s€ô �$‹<× "Ñ " 4Ó (Ð(rcó6—t|«j|«S)a“Search for the selected pattern in the text. Module-level function to access the singleton SearchDialog instance to search using the selected text. With a text selection, perform the search without displaying the dialog. Without a selection, use the prior entry as the search phrase and don't display the dialog. If there has been no prior search, open the search dialog. )rÚfind_selectionrs rrr1s€ô �$‹<× &Ñ & tÓ ,Ð,rcó*—eZdZdZd„Zdd„Zd„Zd„Zy)r z%Dialog for finding a pattern in text.cój—tj|«|jd|jd¬«y)z=Create the base search dialog and add a button for Find Next.z Find NextT)ÚisdefN)rÚcreate_widgetsÚ make_buttonÚdefault_command)Úselfs rr zSearchDialog.create_widgetsAs+€ä×'Ñ'¨Ô-à ×ј d×&:Ñ&:À$ÐÕGrNcóp—|jj«sy|j|j«y)z3Handle the Find Next button as the default command.N)rÚgetprogrr )r#Úevents rr"zSearchDialog.default_commandGs%€à�{‰{×"Ñ"Ô$Ø Ø �‰˜Ÿ ™ Õ"rcó¦—|jj«s|j|«y|jj«sy|jj |«}|rÎ|\}}|j «\}}d||fz}d||fz} |j d«} |j d«} | |k(r| |k(r|j«y|jddd«|jd||«|jd|jj«xr|xs|«|jd«y |j«y#t$rYŒ†wxYw) a2Repeat the last search. If no search was previously run, open a new search dialog. In this case, no search is done. If a search was previously run, the search dialog won't be shown and the options from the previous search (including the search pattern) will be used to find the next occurrence of the pattern. Next is relative based on direction. Position the window to display the located occurrence in the text. Return True if the search was successful and False otherwise. Fz%d.%drrÚselú1.0ÚendÚinsertT)rÚgetpatrr%Ú search_textÚspanÚindexÚbellrÚ tag_removeÚtag_addÚmark_setÚisbackÚsee) r#r ÚresÚlineÚmÚiÚjÚfirstÚlastÚselfirstÚsellasts rrzSearchDialog.find_againMs1€ð �{‰{×!Ñ!Ô#Ø �I‰I�dŒOØØ�{‰{×"Ñ"Ô$ØØ�k‰k×%Ñ% dÓ+ˆÙ ؉GˆD�!Ø—6‘6“8‰DˆAˆqؘt Q˜iÑ'ˆEؘd A˜YÑ&ˆDð ØŸ:™: kÓ2�ØŸ*™* ZÓ0�ؘuÒ$¨°DªØ—I‘I”KØ ð �O‰O˜E 5¨%Ô 0Ø �L‰L˜  tÔ ,Ø �M‰M˜( D§K¡K×$6Ñ$6Ó$8Ò$B¸UÒ$JÀdÔ KØ �H‰H�XÔ Øà �I‰IŒKØøôò Ùð ús s„Ù+òHó #ò *óX %rr có¸‡ —ddlm}m}ddlm}m}||«}|j d«tt|j«jd«dd«\}}|jd||d zfz«||«}|j«||d ¬ «Š ‰ j«‰ jd d «ˆ fd„} ||d| ¬«} | j«y)zDisplay search test box.r)ÚToplevelÚText)ÚFrameÚButtonzTest SearchDialogÚ+éNz+%d+%dé¯Úgray)Úinactiveselectbackgroundr+z}This is a sample string. This is a sample string. This is a sample string. This is a sample string. This is a sample string. c󆕗‰jddd«t‰«j‰«‰jddd«y)Nr(r)r*)r2rrr1rs€rÚ show_findz!_search_dialog..show_find—s5ø€Ø � ‰ �U˜E 5Ô)܈t‹ ×ј$ÔØ �‰˜˜u eÕ,rzSearch (selection ignored))r Úcommand) ÚtkinterrGrHÚ tkinter.ttkrIrJÚtitleÚmapÚintÚgeometryÚsplitÚpackr+) ÚparentrGrHrIrJÚtopÚxÚyÚframerQÚbuttonr s @rÚ_search_dialogra‡s·ø€ç&ß)á �6Ó €C؇I�IÐ!Ô"Ü Œs�F—O‘OÓ%×+Ñ+¨CÓ0°°Ð4Ó 5�D€A€q؇L�L�˜Q  C¡˜LÑ(Ô)á �#‹J€EØ ‡J�J„LÙ �°Ô 7€D؇I�I„K؇K�K�Ð7Ô8ô-ñ �EÐ <ÀiÔ P€FØ ‡K�K…MrÚ__main__)Úmainzidlelib.idle_test.test_searchéF)Ú verbosityÚexit)ÚrunN)rDrSrÚidlelibrÚidlelib.searchbaserrrrrr rarAÚunittestrcÚidlelib.idle_test.htestrgrErrÚrlshðñõ å Ý/ò  ò (ò )ò -ôF%Ð#ôF%òRð2 ˆzÒÝÙÐ (°A¸EÕBå+ÙˆÕð r