� L�g~����dZddlZddlZddlZddlmZmZmZmZm Z m Z m Z mZmZGd�de��Z Gd�de ��Zej��Gd�d e����ZdS) z8 This module provides the base definition for patterns. �N) �Any�AnyStr�Iterable�Iterator�Match�Optional�Pattern�Tuple�Unionc�v�eZdZdZdZdeeddfd�Zdee de e fd�Z d 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 )�selfrs �`/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/pathspec/pattern.py�__init__zPattern.__init__s���$�,����filesc#�K�tjd�|j���td���|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)rr�files r�matchz Pattern.match.sy���� �-�� �F�t�~�F��� 2�q� B�B�B�B� ���d� �o�o�d���'� �J�J�J���rr!c�R�td�|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)�NotImplementedErrorrr)rr!s rr zPattern.match_fileFs*�� �D� �F�t�~�F��� � � r)�__name__� __module__� __qualname__�__doc__� __slots__r�boolrr�strrr"rr �rrr r s��������� ���X�d�^������� ��� ��(�3�-�����0  �C�  �H�S�M�  �  �  �  �  �  rr c���eZdZdZdZ ddeeedfdee ddf�fd� Z ddde fd �Z d e ded fd �Z ede dee e ffd ���Z�xZS)� RegexPatternza The :class:`RegexPattern` class is an implementation of a pattern using regular expressions. )�pattern�regexNr/rrc���t|ttf��rB|�Jd|�d|�d����|�|��\}}|�t j|��}n>|�t |d��r|}n)|�|�Jd|�d|�d����ntd|�d����tt|��� |��||_ ||_ dS) a( Initializes the :class:`RegexPattern` instance. *pattern* (:class:`str`, :class:`bytes`, :class:`re.Pattern`, or :data:`None`) is the pattern to compile into a regular expression. *include* (:class:`bool` or :data:`None`) must be :data:`None` unless *pattern* is a precompiled regular expression (:class:`re.Pattern`) in which case it is whether matched files should be included (:data:`True`), excluded (:data:`False`), or is a null operation (:data:`None`). .. NOTE:: Subclasses do not need to support the *include* parameter. Nzinclude:z must be null when pattern:z is a string.r"z is null.zpattern:z& is not a string, re.Pattern, or None.) � isinstancer+�bytes�pattern_to_regex�re�compile�hasattr� TypeError�superr.rr/r0)rr/rr0rs �rrzRegexPattern.__init___s���&��#�u��&�&�Q� �/�/�M�w�M�M�W�M�M�M� �/�/��)�)�'�2�2�>�5�'��� �J�u� � �E����w�w��8�8�� �5�5��� �/�/�I�w�I�I�W�I�I�I� �/�/�/� �O�g�O�O�O� P� P�P�� �d���$�$�W�-�-�-�3:�$�,�� "�$�*��r�otherc�z�t|t��r |j|jko|j|jkStS)z� Tests the equality of this regex pattern with *other* (:class:`RegexPattern`) by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex` attributes. )r2r.rr0�NotImplemented)rr:s r�__eq__zRegexPattern.__eq__�s9�� ��|�$�$�� �,�%�-� '� E�D�J�%�+�,E�E� �rr!�RegexMatchResultc�j�|j�+|j�|��}|�t|��SdS)a  Matches this pattern against the specified file. *file* (:class:`str`) contains each file relative to the root directory (e.g., "relative/path/to/file"). Returns the match result (:class:`.RegexMatchResult`) if *file* matched; otherwise, :data:`None`. N)rr0r"r>)rr!r"s rr zRegexPattern.match_file�s:�� �\�� �:� � �D� !� !�5� �� �E� "� "�"� �rc� �|dfS)a� Convert the pattern into an uncompiled regular expression. *pattern* (:class:`str`) is the pattern to convert into a regular expression. Returns the uncompiled regular expression (:class:`str` or :data:`None`), and whether matched files should be included (:data:`True`), excluded (:data:`False`), or is a null-operation (:data:`None`). .. NOTE:: The default implementation simply returns *pattern* and :data:`True`. Tr,)rr/s rr4zRegexPattern.pattern_to_regex�s�� �$��r)N)r%r&r'r(r)r r� PatternHintrr*rr=r+r � classmethodr r4� __classcell__)rs@rr.r.Ss��������� ��!�7�7� ���d�*� +�7� �D�>�7� � 7�7�7�7�7�7�r �� �D� � � � ��C��H�-?�$@�����"��C��E�#�t�)�,<�����+�����rr.c�"�eZdZUdZdZeed<dS)r>zq The :class:`RegexMatchResult` data class is used to return information about the matched regular expression. )r"r"N)r%r&r'r(r)� MatchHint�__annotations__r,rrr>r>�s5��������� �� �����rr>)r(� dataclassesr5r�typingrrrrrrErr rAr r �objectr.� dataclassr>r,rr�<module>rKsG�������� � � � ����� � � � � � � � � � � � � � � � � � � � � � �< �< �< �< �< �f�< �< �< �~p�p�p�p�p�7�p�p�p�f����������v�������r
Memory