Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.223.159.189
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : search.cpython-311.pyc
�

Tf�����dZddlmZddlmZddlmZd�Zd�Zd�Z	d�Z
Gd	�d
e��Zd�Ze
dkr'dd
lmZeddd���ddlmZee��dSdS)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��|���}tj|��}t|d��st	||��|_|jS)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   �7/usr/local/python-3.11/lib/python3.11/idlelib/search.py�_setuprsN���:�:�<�<�D�
�
�d�
#�
#�F��6�?�+�+�:�+�D�&�9�9������c�t�|�dd��}t|���||��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�findrs3���(�(�;�
�
+�
+�C��$�<�<���T�3�'�'�'rc�F�t|���|��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�F�t|���|��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�ZdS)rz%Dialog for finding a pattern in text.c�h�tj|��|�d|jd���dS)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_widgetsAs7���'��-�-�-�����d�&:�$��G�G�G�G�GrNc�p�|j���sdS|�|j��dS)z3Handle the Find Next button as the default command.N)r�getprogrr)r#�events  rr"zSearchDialog.default_commandGs7���{�"�"�$�$�	��F�����	�"�"�"�"�"rc��|j���s|�|��dS|j���sdS|j�|��}|r�|\}}|���\}}d||fz}d||fz}	|�d��}	|�d��}
|	|kr|
|kr|���dSn#t$rYnwxYw|�	ddd��|�
d||��|�d|j���r|p|��|�
d��d	S|���dS)
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_againMs��� �{�!�!�#�#�	��I�I�d�O�O�O��5��{�"�"�$�$�	��5��k�%�%�d�+�+���	��G�D�!��6�6�8�8�D�A�q��t�Q�i�'�E��d�A�Y�&�D�
��:�:�k�2�2���*�*�Z�0�0���u�$�$��D����I�I�K�K�K� �5����
�
�
���
�����O�O�E�5�%�0�0�0��L�L���t�,�,�,��M�M�(�D�K�$6�$6�$8�$8�$B�U�$J�d�K�K�K��H�H�X�����4��I�I�K�K�K��5s�A
C � 
C-�,C-c��|�dd��}|r|j�|��|�|��S)a/Search for selected text with previous dialog preferences.

        Instead of using the same pattern for searching (as Find
        Again does), this first resets the pattern to the currently
        selected text.  If the selected text isn't changed, then use
        the prior search phrase.
        rr)r	r�setcookedpatr)r#rrs   rrzSearchDialog.find_selectionysG���h�h�{�J�/�/���	*��K�$�$�S�)�)�)����t�$�$�$r)N)�__name__�
__module__�__qualname__�__doc__r r"rr�rrrr>s_������+�+�H�H�H�#�#�#�#�*�*�*�X%�%�%�%�%rrc�&��ddlm}m}ddlm}m}||��}|�d��tt|�	���
d��dd���\}}|�	d||d	zfz��||��}|���||d
����������dd
���fd�}	||d|	���}
|
���dS)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�����ddd��t���������ddd��dS)Nr(r)r*)r2rrr1rs�r�	show_findz!_search_dialog.<locals>.show_find�sO������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�0����4�5�5�D�A�q��L�L��Q��C��L�(�)�)�)��E�#�J�J�E�	�J�J�L�L�L��4���7�7�7�D��I�I�K�K�K��K�K��7�8�8�8�-�-�-�-�-�
�V�E� <�i�
P�
P�
P�F�
�K�K�M�M�M�M�Mr�__main__)�mainzidlelib.idle_test.test_search�F)�	verbosity�exit)�runN)rDrSr�idlelibr�idlelib.searchbaserrrrrrrarA�unittestrc�idlelib.idle_test.htestrgrErr�<module>rls-���������� � � � � � �/�/�/�/�/�/�
 �
 �
 �	(�	(�	(�	)�	)�	)�
-�
-�
-�F%�F%�F%�F%�F%�#�F%�F%�F%�R���2�z����������D�	(�A�E�B�B�B�B�+�+�+�+�+�+��C��������r
© 2025 GrazzMean