
    ˆh~                         S r SSKrSSKrSSKrSSKJrJrJrJrJ	r
JrJrJrJr   " S S\5      r " S S\5      r\R$                  " 5        " S S	\5      5       rg)
z8
This module provides the base definition for patterns.
    N)	AnyAnyStrIterableIteratorMatchOptionalPatternTupleUnionc                   j    \ rS rSrSrSrS\\   SS4S jrS\	\
   S\\
   4S	 jrS
\
S\\   4S jrSrg)r	      zE
The :class:`Pattern` class is the abstract definition of a pattern.
includer   returnNc                     Xl         g)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     H/opt/services/DDDS/venv/lib/python3.13/site-packages/pathspec/pattern.py__init__Pattern.__init__   s     ,    filesc              #      #    [         R                  " SR                  U R                  S9[        SS9  U H  nU R                  U5      c  M  Uv   M     g7f)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   matchPattern.match.   sP      -- Ft~~F 2q	B d
ood'
J s   AA	Ar#   c                 F    [        SR                  U R                  S95      e)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"   Pattern.match_fileF   s$     	D
Ft~~F	   r   )__name__
__module____qualname____firstlineno____doc__	__slots__r   boolr   r   strr   r$   r   r"   __static_attributes__ r   r   r	   r	      sW    
Xd^    (3- 0
 C 
 HSM 
 r   r	   c                      ^  \ rS rSrSrSr SS\\\S4   S\	\
   SS4U 4S jjjrS	S S\
4S
 jrS\S\	S   4S jr\S\S\\\
4   4S j5       rSrU =r$ )RegexPatternS   z^
The :class:`RegexPattern` class is an implementation of a pattern using
regular expressions.
)patternregexNr6   r   r   c                 z  > [        U[        [        45      (       a@  Ub   SU< SU< S35       eU R                  U5      u  p2Ub  [        R
                  " U5      nO>Ub  [        US5      (       a  UnO'Uc  Ub   SU< SU< S35       eO[        SU< S35      e[        [        U ]+  U5        Xl         WU l        g)	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.
Nzinclude:z must be null when pattern:z is a string.r$   z	 is null.zpattern:z& is not a string, re.Pattern, or None.)
isinstancer0   bytespattern_to_regexrecompilehasattr	TypeErrorsuperr4   r   r6   r7   )r   r6   r   r7   r    s       r   r   RegexPattern.__init___   s    & #u&&
/ wk4WK}M/ ))'2>5 JJuEww88 5 / wk4WKyI/
 
Xg[(NO	PPd$W-3:,
 "$*r   otherc                     [        U[        5      (       a9  U R                  UR                  :H  =(       a    U R                  UR                  :H  $ [        $ )z
Tests the equality of this regex pattern with *other* (:class:`RegexPattern`)
by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex`
attributes.
)r9   r4   r   r7   NotImplemented)r   rB   s     r   __eq__RegexPattern.__eq__   s<     |$$
,,%--
'
EDJJ%++,EE
r   r#   RegexMatchResultc                 p    U R                   b)  U R                  R                  U5      nUb  [        U5      $ g)z
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)r   r7   r$   rG   )r   r#   r$   s      r   r"   RegexPattern.match_file   s6     
\\::D!5E""	r   c                 
    US4$ )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`.
Tr2   )r   r6   s     r   r;   RegexPattern.pattern_to_regex   s     
$r   )N)r)   r*   r+   r,   r-   r.   r   r   PatternHintr   r/   r   rE   r0   r"   classmethodr
   r;   r1   __classcell__)r    s   @r   r4   r4   S   s     !7d*+7 D>7 	7 7r	 	D 	C H-?$@ " C E#t),<  r   r4   c                   (    \ rS rSr% SrSr\\S'   Srg)rG      zn
The :class:`RegexMatchResult` data class is used to return information about
the matched regular expression.
)r$   r$   r2   N)	r)   r*   r+   r,   r-   r.   	MatchHint__annotations__r1   r2   r   r   rG   rG      s     	r   rG   )r-   dataclassesr<   r   typingr   r   r   r   r   rQ   r   r	   rL   r
   r   objectr4   	dataclassrG   r2   r   r   <module>rW      sd     	 	 	 	< f < ~p7 pf v  r   