�
�S�g� � �t � d Z ddlmZ ddlZddlZddlZddlmZmZ ddl m
Z
mZmZ e
r
ddl
mZmZmZ g d�Zddd�Zddd �Zdd
�Zedd�� Zedd�� Zdd
�Zd� Zed d�� Zed!d�� Zd"d�Zed#d�� Zed$d�� Zd%d�Z ej2 d� Z ej2 d� Zd&d�Zd'd�Zd� Zy)(z�
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.
Changes include:
* `yield from` and PEP3102 `*` removed.
* Hidden files are not ignored.
� )�annotationsN)�Iterable�Iterator)�
TYPE_CHECKING�AnyStr�overload)� BytesPath�StrOrBytesPath�StrPath)�glob�iglob�escapec �. � t t | |�� � S )ay Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
)� recursive)�listr
)�pathnamer s �/build/snapcraft-certbot-29b1212f749eeba2f1dece1adfe9a83a/parts/certbot/install/lib/python3.12/site-packages/setuptools/glob.pyr r s � � ��h�)�4�5�5� c �V � t | |� }|rt | � rt |� }|rJ �|S )a� Return an iterator which yields the paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
)�_iglob�_isrecursive�next)r r �it�ss r r
r
% s/ � �
��)� $�B��\�(�+���H����u�
�Ir c # �( K � t j j | � \ }}|rt |� rt nt
}t
| � sJ|r$t j j | � r| �� y t j j |� r| �� y |s |||� E d { ��� y || k7 rt
|� r
t ||� }n|g}t
|� st }|D ]2 } |||� D ]$ }t j j ||� �� �& �4 y 7 �n�w�N)�os�path�splitr �glob2�glob1� has_magic�lexists�isdirr �glob0�join)r r �dirname�basename�glob_in_dir�dirs�names r r r 7 s� � �� ����
�
�h�/��G�X�$��h�)?�%�U�K��X����w�w���x�(���
� �w�w�}�}�W�%������w��1�1�1�� �(��y��1�!'���!;���y���X����� .�����2� .�D��'�'�,�,�w��-�-� .�.� 2�s �BD�!D�"A/Dc � � y r � �r' |