| Server IP : 121.121.20.254 / Your IP : 216.73.217.141 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/idlelib/__pycache__/ |
Upload File : |
�
���g@ � �� � d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m
Z
ddlmZ dd�Z
d� Zd � Z G d
� de
� Zd� Zed
k( r ddlmZ eddd�� ddlmZ ee� yy)z�Grep dialog for Find in Files functionality.
Inherits from SearchDialogBase for GUI and uses searchengine
to prepare search pattern.
� N)� StringVar�
BooleanVar)�Checkbutton)�SearchDialogBase)�searchenginec �� � | j � }t j |� }t |d� st |||� |_ |j
}| j dd� }|j
| ||� y)a� Open the Find in Files dialog.
Module-level function to access the singleton GrepDialog
instance and open the dialog. If text is selected, it is
used as the search phrase; otherwise, the previous entry
is used.
Args:
text: Text widget that contains the selected text for
default search phrase.
io: iomenu.IOBinding instance with default path to search.
flist: filelist.FileList instance for OutputWindow parent.
�_grepdialogz sel.firstzsel.lastN)�_rootr �get�hasattr�
GrepDialogr �open)�text�io�flist�root�engine�dialog�searchphrases �!C:\Python312\\Lib\idlelib\grep.py�grepr se � � �:�:�<�D�
�
�
�d�
#�F��6�=�)�'��f�e�<���
�
�
�F��8�8�K��4�L�
�K�K��l�B�'� c � � t | � y)zHandle os.walk error.N)�print)�msgs r �
walk_errorr + s � � �#�Jr c # � ��K � t j | t �� D ] \ �}}��fd�|D � E d{ ��� |r� y y7 ��w)z�Generate file names in dir that match pattern.
Args:
folder: Root directory to search.
pattern: File pattern to match.
recursive: True to include subdirectories.
)�onerrorc 3 � �K � | ]: }t j |�� r"t j j �|� �� �< y �w�N)�fnmatch�os�path�join)�.0�name�dirpath�patterns ��r � <genexpr>zfindfiles.<locals>.<genexpr>9 s6 �� �� � 7� )�����t�W�5� �G�G�L�L��$�/� )�s �A AN)r"