
    ˆh                         S r SSKJrJrJrJrJrJrJrJ	r	J
r
Jr  SSKJr  SSKJr  SSKJrJr  SSKJr  \" SS	S
9r  " S S	\5      rg)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                   z  ^  \ rS rSrSrS\S\4U 4S jjr\\	S\
\   S\\\\/\4   4   S\\   S\4S	 j5       5       r\\	 SS\
\   S\\   S\\\\/\4   S
4   S\4S jj5       5       r\	 SS\
\   S\\   S\\\\/\4   S
4   S\4U 4S jjj5       r\S\\\\4      S\S\\\   \\   4   4S j5       rSrU =r$ )r   #   zr
The :class:`GitIgnoreSpec` class extends :class:`pathspec.pathspec.PathSpec` to
replicate *.gitignore* behavior.
otherreturnc                    > [        U[        5      (       a  [        TU ]  U5      $ [        U[        5      (       a  g[
        $ )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     J/opt/services/DDDS/venv/lib/python3.13/site-packages/pathspec/gitignore.pyr   GitIgnoreSpec.__eq__)   s7     }%%
'.
%""

    clspattern_factorylinesc                     g N )r$   r%   r&   s      r!   
from_linesGitIgnoreSpec.from_lines7        r#   Nc                     g r(   r)   )r$   r&   r%   s      r!   r*   r+   @   r,   r#   c                    > Uc  [         nO=[        U[        [        45      (       d  [	        U5      (       a  [        U5      (       a  Xp[        TU ]  X!5      n[        [        U5      $ )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.
)
r   r   strbytescallabler   r   r*   r   r   )r$   r&   r%   r   r    s       r!   r*   r+   I   sT    . (?53,''8E??_@]@]!E		O	3$	dD	r#   patternsfilec                 h   SnSnSnU  H  u  pVUR                   c  M  UR                  U5      nUc  M*  UR                  R                  5       R	                  [
        5      nU(       a  Sn	OSn	UR                   (       a  U(       a  UR                   nUnU	nM  X:  d  M  UR                   nUnU	nM     X#4$ )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`).
Nr   r      )include
match_filematch	groupdictgetr   )
r2   r3   out_include	out_indexout_priorityindexpatternr8   dir_markprioritys
             r!   _match_fileGitIgnoreSpec._match_filej   s    . !%+!), neoo!t$E %%'++I6Xh hHOOkil

"OOkil/ !2 
	r#   r)   r(   )__name__
__module____qualname____firstlineno____doc__objectboolr   r   classmethodr   r   r
   r/   r   r   r   r   r*   staticmethodr   intr   r   rB   __static_attributes____classcell__)r    s   @r!   r   r   #   s   
 D  Dzhx'899: 
&	 	    DHDz	&	 hx'894?@ 	    DHDz	&	 hx'894?@ 	 @ 2 U3 33452 2  HTNHSM)*2  2 r#   N)rH   typingr   r   r   r   r   r   r	   r
   r   r   pathspecr   r?   r   patterns.gitwildmatchr   r   utilr   r   r   r)   r#   r!   <module>rT      sN   

 
 

 v_-z H z r#   