�
L�g~ � �� � d Z ddlZddlZddlZddlmZmZmZmZm Z
mZmZ
mZmZ G d� de� � Z G d� de� � Z ej � � G d� d e� � � � ZdS )
z8
This module provides the base definition for patterns.
� N) �Any�AnyStr�Iterable�Iterator�Match�Optional�Pattern�Tuple�Unionc �v � e Zd ZdZdZdee ddfd�Zdee de
e fd�Zd e dee fd
�Z
dS )r zG
The :class:`Pattern` class is the abstract definition of a pattern.
��includer �returnNc � � || _ dS )z�
Initializes the :class:`Pattern` instance.
*include* (:class:`bool` or :data:`None`) is whether the matched files
should be included (:data:`True`), excluded (:data:`False`), or is a
null-operation (:data:`None`).
Nr
)�selfr s �`/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/pathspec/pattern.py�__init__zPattern.__init__ s � � �$�,�� � �filesc # � K � t j d� | j �� � t d�� � |D ]}| � |� � �|V � �dS )a�
DEPRECATED: This method is no longer used and has been replaced by
:meth:`.match_file`. Use the :meth:`.match_file` method with a loop for
similar results.
Matches this pattern against the specified files.
*files* (:class:`~collections.abc.Iterable` of :class:`str`) contains each
file relative to the root directory (e.g., ``"relative/path/to/file"``).
Returns an :class:`~collections.abc.Iterable` yielding each matched file
path (:class:`str`).
z�{cls.__module__}.{cls.__qualname__}.match() is deprecated. Use {cls.__module__}.{cls.__qualname__}.match_file() with a loop for similar results.��cls� )�
stacklevelN)�warnings�warn�format� __class__�DeprecationWarning�
match_file)r r �files r �matchz
Pattern.match. sy � � � � �-�� �F�t�~�F��� 2�q� B� B� B� B� � � �d�
�o�o�d���'�
�J�J�J��� r r! c �R � t d� | j �� � � � �)z�
Matches this pattern against the specified file.
*file* (:class:`str`) is the normalized file path to match against.
Returns the match result if *file* matched; otherwise, :data:`None`.
z?{cls.__module__}.{cls.__qualname__} must override match_file().r )�NotImplementedErrorr r )r r! s r r zPattern.match_fileF s* � � �D�
�F�t�~�F��� � � r )�__name__�
__module__�__qualname__�__doc__� __slots__r �boolr r �strr r"