| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.10/idlelib/__pycache__/ |
Upload File : |
o
�9j7 � @ s� d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m
Z
ddlmZ ddd�Z
d d
� Zdd� ZG d
d� de
�Zdd� Zedkr^ddlmZ edddd� ddlmZ ee� dS dS )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 C sN | � � }t�|�}t|d�st|||�|_|j}| �dd�}|�| ||� dS )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�searchphrase� r �#/usr/lib/python3.10/idlelib/grep.py�grep s
r c C s t | � dS )zHandle os.walk error.N)�print)�msgr r r �
walk_error+ s r c # sD � t j| td�D ]\� }}� �fdd�|D �E dH |s dS qdS )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 s* � | ]}t � |��rtj�� |�V qd S �N)�fnmatch�os�path�join)�.0�name��dirpath�patternr r � <genexpr>9 s
�
�zfindfiles.<locals>.<genexpr>N)r �walkr )�folderr$ � recursive�_� filenamesr r"