shell bypass 403
�
Tff � �� � d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m
Z
ddlmZ dd�Z
d� Zd � Z G d
� de
� � Zd� Zed
k r'ddlmZ eddd�� � 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 �
� | � � � }t j |� � }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�searchphrases �5/usr/local/python-3.11/lib/python3.11/idlelib/grep.py�grepr s~ � � �:�:�<�<�D�
�
�d�
#�
#�F��6�=�)�)� =�'��f�e�<�<���
�
�F��8�8�K��4�4�L�
�K�K��l�B�'�'�'�'�'� c �$ � t | � � dS )zHandle os.walk error.N)�print)�msgs r �
walk_errorr + s � � �#�J�J�J�J�Jr c # � ��K � t j | t �� � D ] \ �}}��fd�|D � � E d{V �� |s dS �!dS )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 � | ]9}t j |�� � �t j � �|� � V � �:d S �N)�fnmatch�os�path�join)�.0�name�dirpath�patterns ��r � <genexpr>zfindfiles.<locals>.<genexpr>9 sX �� � � � 7� 7����t�W�5�5�7�B�G�L�L��$�/�/� 7� 7� 7� 7� 7� 7r N)r"