� L�g���dZddlmZmZmZmZmZmZmZm Z m Z m Z ddl m Z ddlmZddlmZmZddlmZedd � ��Z Gd �d e ��Zd S) zV This module provides :class:`.GitIgnoreSpec` which replicates *.gitignore* behavior. �) �AnyStr�Callable�Iterable�Optional�Tuple�Type�TypeVar�Union�cast�overload�)�PathSpec)�Pattern)�GitWildMatchPattern� _DIR_MARK)� _is_iterable�Self� GitIgnoreSpec)�boundc ����eZdZdZdedef�fd� Zeede e de e e egeffdeede fd�����Zee dde e deede e e egefd fde fd �����Ze dde e deede e e egefd fde f�fd � ��Zed eeeefd e deeeeeffd���Z�xZS)rzu The :class:`GitIgnoreSpec` class extends :class:`pathspec.pathspec.PathSpec` to replicate *.gitignore* behavior. �other�returnc���t|t��r!t���|��St|t��rdSt S)z� Tests the equality of this gitignore-spec with *other* (:class:`GitIgnoreSpec`) by comparing their :attr:`~pathspec.pattern.Pattern` attributes. A non-:class:`GitIgnoreSpec` will not compare equal. F)� isinstancer�super�__eq__r�NotImplemented)�selfr� __class__s ��b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/pathspec/gitignore.pyrzGitIgnoreSpec.__eq__)sJ��� ��}�%�%�� �'�'�.�.�� � ���%��"�"�� �%� ���cls�pattern_factory�linesc��dS�N�)r"r#r$s r � from_lineszGitIgnoreSpec.from_lines7� ���#r!Nc��dSr&r')r"r$r#s r r(zGitIgnoreSpec.from_lines@r)r!c���|�t}n>t|ttf��st |��rt |��r||}}t ���||��}tt|��S)a� Compiles the pattern lines. *lines* (:class:`~collections.abc.Iterable`) yields each uncompiled pattern (:class:`str`). This simply has to yield each line so it can be a :class:`io.TextIOBase` (e.g., from :func:`open` or :class:`io.StringIO`) or the result from :meth:`str.splitlines`. *pattern_factory* can be :data:`None`, the name of a registered pattern factory (:class:`str`), or a :class:`~collections.abc.Callable` used to compile patterns. The callable must accept an uncompiled pattern (:class:`str`) and return the compiled pattern (:class:`pathspec.pattern.Pattern`). Default is :data:`None` for :class:`.GitWildMatchPattern`). Returns the :class:`GitIgnoreSpec` instance. ) rr�str�bytes�callablerrr(r r)r"r$r#rrs �r r(zGitIgnoreSpec.from_linesIsv���.��(�?�?��5�3��,�'�'�3�8�E�?�?�3� �_�@]�@]�3�!�?�E�?� ��� � �O�U� 3� 3�$� �d�D� � �r!�patterns�filec��d}d}d}|D]�\}}|j�u|�|��}|�^|j����t ��}|rd} nd} |jr|r |j}|}| }�p| |kr |j}|}| }��||fS)a� Check the file against the patterns. .. NOTE:: Subclasses of :class:`~pathspec.pathspec.PathSpec` may override this method as an instance method. It does not have to be a static method. The signature for this method is subject to change. *patterns* (:class:`~collections.abc.Iterable`) yields each indexed pattern (:class:`tuple`) which contains the pattern index (:class:`int`) and actual pattern (:class:`~pathspec.pattern.Pattern`). *file* (:class:`str`) is the normalized file path to be matched against *patterns*. Returns a :class:`tuple` containing whether to include *file* (:class:`bool` or :data:`None`), and the index of the last matched pattern (:class:`int` or :data:`None`). Nrr �)�include� match_file�match� groupdict�getr) r/r0� out_include� out_index� out_priority�index�patternr5�dir_mark�prioritys r � _match_filezGitIgnoreSpec._match_filejs���.!%�+�!�)��,� ���n�e�W� �o�!� � � �t� $� $�E� ��� �%�%�'�'�+�+�I�6�6�X����h�h��h����H���O�k��i��l�l� �l� "� "��O�k��i��l�� �i� �r!r&)�__name__� __module__� __qualname__�__doc__�object�boolrr � classmethodrrr r,rrrrr(� staticmethodr�intrrr?� __classcell__)rs@r rr#s��������� �� �D� � � � � � � � �� �D�z����h��x��'8�9�9�:�� �&� �� � ����+� �(�� � �DH��� �D�z�� �&� ����h��x��'8�9�4�?�@�� � ����+� �(���DH��� �D�z�� �&� ����h��x��'8�9�4�?�@�� � ������+��@�2 � �U�3� 3�3�4� 5�2 � �2 � �H�T�N�H�S�M� )�*�2 �2 �2 ��,�2 �2 �2 �2 �2 r!N)rC�typingrrrrrrr r r r �pathspecrr<r�patterns.gitwildmatchrr�utilrrrr'r!r �<module>rNsb����  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  � � � � � � � � � � � � � � � � � � � � ��������w�v�_�-�-�-��� z �z �z �z �z �H�z �z �z �z �z r!
Memory