+
    UBi3                         R t ^ RIHt ^ RIHt ^ RIHtHtHtH	t	H
t
HtHtHtHt ^RIHt ^RIHt ^RIHtHtHtHtHtHtHt ]! RRR	7      t  ! R
 R]4      tR# )zR
This module provides an object oriented interface for pattern matching of files.
)
Collection)zip_longest)	AnyStrCallabler   IterableIteratorOptionalTypeTypeVarUnion)util)Pattern)CheckResultStrPathTStrPath	TreeEntry_filter_check_patterns_is_iterablenormalize_fileSelfPathSpec)boundc                     a  ] tR t^'t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	R!V 3R lR llt
R!V 3R lR lltR"V 3R lR llt]V 3R lR l4       tR!RR/V 3R lR lllt]! ]P$                  4      t R!V 3R lR lltR!RR/V 3R lR llltR"RR/V 3R lR llltR"RR/V 3R lR lllt]tR tV tR# )#r   za
The :class:`PathSpec` class is a wrapper around a list of compiled
:class:`.Pattern` instances.
c                4   < V ^8  d   QhRS[ S[,          RR/# )   patternsreturnN)r   r   )format__classdict__s   "6/usr/lib/python3.14/site-packages/pathspec/pathspec.py__annotate__PathSpec.__annotate__-   s       hw/ D     c                T    \        V\        4      '       g   \        V4      pWn        R# )z
Initializes the :class:`PathSpec` instance.

*patterns* (:class:`~collections.abc.Collection` or :class:`~collections.abc.Iterable`)
yields each compiled pattern (:class:`.Pattern`).
N)
isinstanceCollectionTypelistr   )selfr   s   &&r   __init__PathSpec.__init__-   s$     
Hn	-	-8n8'/-r"   c                &   < V ^8  d   QhRS[ RS[/# )r   otherr   )objectbool)r   r   s   "r   r    r!   =   s     	 	 	D 	r"   c                    \        V\        4      '       dU   \        V P                  VP                  4      p\        ;QJ d    R V 4       F  '       d   K   R# 	  R# ! R V 4       4      # \
        # )z
Tests the equality of this path-spec with *other* (:class:`PathSpec`)
by comparing their :attr:`~PathSpec.patterns` attributes.
c              3   .   "   T F  w  rW8H  x  K  	  R # 5iN ).0abs   &  r   	<genexpr>"PathSpec.__eq__.<locals>.<genexpr>D   s     1afs   FT)r$   r   r   r   allNotImplemented)r'   r+   paired_patternss   && r   __eq__PathSpec.__eq__=   sT    
 x   ??
#11##1#1#11
11
r"   c                    < V ^8  d   QhRS[ /# )r   r   )int)r   r   s   "r   r    r!   H   s      c r"   c                ,    \        V P                  4      # )zQ
Returns the number of compiled patterns this path-spec contains
(:class:`int`).
)lenr   )r'   s   &r   __len__PathSpec.__len__H   s    
 
T]]	r"   c                *   < V ^8  d   QhRS[ RRRS[ /# r   r'   r+   r   r   r   )r   r   s   "r   r    r!   O   s"      4 
 t r"   c                    \        V\        4      '       d-   V P                  V P                  VP                  ,           4      # \        # )zW
Combines the :attr:`Pathspec.patterns` patterns from two
:class:`PathSpec` instances.
)r$   r   	__class__r   r8   r'   r+   s   &&r   __add__PathSpec.__add__O   s3    
 x  
..7
88
r"   c                *   < V ^8  d   QhRS[ RRRS[ /# rC   rD   )r   r   s   "r   r    r!   Y   s"     	 	D 	 	 	r"   c                    \        V\        4      '       d&   V ;P                  VP                  ,          un        V # \        # )zc
Adds the :attr:`Pathspec.patterns` patterns from one :class:`PathSpec`
instance to this instance.
)r$   r   r   r8   rG   s   &&r   __iadd__PathSpec.__iadd__Y   s.    
 x  ==ENN"=
;
r"   Nc                \   < V ^8  d   QhRS[ RS[S[S[,          ,          RS[S[ ,          /# r   file
separatorsr   )r   r   r   strr   )r   r   s   "r   r    r!   d   s7     + ++ z#'+ (	+r"   c                ~    \        W4      pV P                  \        V P                  4      V4      w  rE\	        WV4      # )a  
Check the files against this path-spec.

*file* (:class:`str` or :class:`os.PathLike`) is the file path to be
matched against :attr:`self.patterns <PathSpec.patterns>`.

*separators* (:class:`~collections.abc.Collection` of :class:`str`; or
:data:`None`) optionally contains the path separators to normalize. See
:func:`~pathspec.util.normalize_file` for more information.

Returns the file check result (:class:`~pathspec.util.CheckResult`).
)r   _match_file	enumerater   r   )r'   rP   rQ   	norm_fileincludeindexs   &&&   r   
check_filePathSpec.check_filed   s8    " T.)##Idmm$<iH.'	TE	**r"   c                |   < V ^8  d   QhRS[ S[,          RS[S[S[,          ,          RS[S[S[,          ,          /# )r   filesrQ   r   )r   r   r   r   rR   r   r   )r   r   s   "r   r    r!   y   sA     0 0	(	0 z#'0 {8$%	0r"   c              #     "   \        V4      '       g   \        RV: R24      h\        V P                  4      pV F/  p\	        WB4      pV P                  W54      w  rg\        WFV4      x  K1  	  R# 5i)a  
Check the files against this path-spec.

*files* (:class:`~collections.abc.Iterable` of :class:`str` or
:class:`os.PathLike`) contains the file paths to be checked against
:attr:`self.patterns <PathSpec.patterns>`.

*separators* (:class:`~collections.abc.Collection` of :class:`str`; or
:data:`None`) optionally contains the path separators to normalize. See
:func:`~pathspec.util.normalize_file` for more information.

Returns an :class:`~collections.abc.Iterator` yielding each file check
result (:class:`~pathspec.util.CheckResult`).
files: is not an iterable.N)r   	TypeErrorr   r   r   rT   r   )r'   r\   rQ   use_patterns	orig_filerV   rW   rX   s   &&&     r   check_filesPathSpec.check_filesy   sh     & 
e			VE9$89	::'6,ii49$$\=>7	Y	// s   A.A0c          
         < V ^8  d   QhRS[ RS[S[S[.R3,          ,          RS[S[,          RS[S[S[,          ,          /# )r   rooton_errorNfollow_linksr   )r   r   r   OSErrorr-   r   r   rR   )r   r   s   "r   r    r!      sQ     % %% Xwio./% 	%
 {3 %r"   c              #  t   "   \         P                  ! WVR7      pV P                  V4       Rj  xL
  R#  L5i)a  
Walks the specified root path for all files and checks them against this
path-spec.

*root* (:class:`str` or :class:`os.PathLike`) is the root directory to
search for files.

*on_error* (:class:`~collections.abc.Callable` or :data:`None`) optionally
is the error handler for file-system exceptions. It will be called with the
exception (:exc:`OSError`). Reraise the exception to abort the walk. Default
is :data:`None` to ignore file-system exceptions.

*follow_links* (:class:`bool` or :data:`None`) optionally is whether to walk
symbolic links that resolve to directories. Default is :data:`None` for
:data:`True`.

*negate* (:class:`bool` or :data:`None`) is whether to negate the match
results of the patterns. If :data:`True`, a pattern matching a file will
exclude the file rather than include it. Default is :data:`None` for
:data:`False`.

Returns an :class:`~collections.abc.Iterator` yielding each file check
result (:class:`~pathspec.util.CheckResult`).
rg   rh   N)r   iter_tree_filesrc   )r'   rf   rg   rh   r\   s   &&&& r   check_tree_filesPathSpec.check_tree_files   s-     < 

t\
R%e$$$s   -868c                   < V ^8  d   QhRS[ S[,          RS[S[S[S[.S[3,          3,          RS[S[,          RS[/# )r   clspattern_factorylinesr   )r	   r   r   rR   r   r   r   r   )r   r   s   "r   r    r!      sP      Dzhx'899: 
&	 	r"   c                8   \        V\        4      '       d   \        P                  ! V4      p\	        V4      '       g   \        RV: R24      h\        V4      '       g   \        RV: R24      hV Uu. uF  q3'       g   K  V! V4      NK  	  ppV ! V4      # u upi )aS  
Compiles the pattern lines.

*pattern_factory* can be either the name of a registered pattern factory
(:class:`str`), or a :class:`~collections.abc.Callable` used to compile
patterns. It must accept an uncompiled pattern (:class:`str`) and return the
compiled pattern (:class:`.Pattern`).

*lines* (:class:`~collections.abc.Iterable`) yields each uncompiled pattern
(:class:`str`). This simply has to yield each line so that it can be a
:class:`io.TextIOBase` (e.g., from :func:`open` or :class:`io.StringIO`) or
the result from :meth:`str.splitlines`.

Returns the :class:`PathSpec` instance.
zpattern_factory:z is not callable.zlines:r_   )r$   rR   r   lookup_patterncallabler`   r   )rp   rq   rr   liner   s   &&&  r   
from_linesPathSpec.from_lines   s    * %%((9?	/	"	"	%o%88IJ	KK	e			VE9$89	::05>#od#(>	X ?s   3	BBnegatec          	         < V ^8  d   QhRS[ S[,          RS[S[S[,          ,          RS[S[,          RS[S[,          /# )r   entriesrQ   ry   r   )r   r   r   r   rR   r-   r   )r   r   s   "r   r    r!      sJ     % %I% z#'%
 4.% y%r"   c             #    "   \        V4      '       g   \        RV: R24      h\        V P                  4      pV FI  p\	        VP
                  V4      pV P                  WF4      w  rxV'       d   V'       * pV'       g   KE  Vx  KK  	  R# 5i)a  
Matches the entries to this path-spec.

*entries* (:class:`~collections.abc.Iterable` of :class:`~pathspec.util.TreeEntry`)
contains the entries to be matched against :attr:`self.patterns <PathSpec.patterns>`.

*separators* (:class:`~collections.abc.Collection` of :class:`str`; or
:data:`None`) optionally contains the path separators to normalize. See
:func:`~pathspec.util.normalize_file` for more information.

*negate* (:class:`bool` or :data:`None`) is whether to negate the match
results of the patterns. If :data:`True`, a pattern matching a file will
exclude the file rather than include it. Default is :data:`None` for
:data:`False`.

Returns the matched entries (:class:`~collections.abc.Iterator` of
:class:`~pathspec.util.TreeEntry`).
zentries:r_   N)r   r`   r   r   r   pathrT   )	r'   r{   rQ   ry   ra   entryrV   rW   _indexs	   &&&$     r   match_entriesPathSpec.match_entries   su     2 
g			Xg[(<=	>>'6,eejj*59%%l>?7kGg
K s   A9B
 
B
c                L   < V ^8  d   QhRS[ RS[S[S[,          ,          RS[/# rO   )r   r   r   rR   r-   )r   r   s   "r   r    r!     s2       z#' 	r"   c                |    \        W4      pV P                  \        V P                  4      V4      w  rE\	        V4      # )a  
Matches the file to this path-spec.

*file* (:class:`str` or :class:`os.PathLike`) is the file path to be
matched against :attr:`self.patterns <PathSpec.patterns>`.

*separators* (:class:`~collections.abc.Collection` of :class:`str`)
optionally contains the path separators to normalize. See
:func:`~pathspec.util.normalize_file` for more information.

Returns :data:`True` if *file* matched; otherwise, :data:`False`.
)r   rT   rU   r   r-   )r'   rP   rQ   rV   rW   r   s   &&&   r   
match_filePathSpec.match_file  s5    " T.)$$Yt}}%=yI/'	gr"   c          	         < V ^8  d   QhRS[ S[,          RS[S[S[,          ,          RS[S[,          RS[S[,          /# )r   r\   rQ   ry   r   )r   r   r   r   rR   r-   r   )r   r   s   "r   r    r!     sJ     & &	'	& z#'&
 4.& w&r"   c             #    "   \        V4      '       g   \        RV: R24      h\        V P                  4      pV F>  p\	        WR4      pV P                  WF4      w  rxV'       d   V'       * pV'       g   K:  Vx  K@  	  R# 5i)a  
Matches the files to this path-spec.

*files* (:class:`~collections.abc.Iterable` of :class:`str` or
:class:`os.PathLike`) contains the file paths to be matched against
:attr:`self.patterns <PathSpec.patterns>`.

*separators* (:class:`~collections.abc.Collection` of :class:`str`; or
:data:`None`) optionally contains the path separators to normalize. See
:func:`~pathspec.util.normalize_file` for more information.

*negate* (:class:`bool` or :data:`None`) is whether to negate the match
results of the patterns. If :data:`True`, a pattern matching a file will
exclude the file rather than include it. Default is :data:`None` for
:data:`False`.

Returns the matched files (:class:`~collections.abc.Iterator` of
:class:`str` or :class:`os.PathLike`).
r^   r_   N)r   r`   r   r   r   rT   )	r'   r\   rQ   ry   ra   rb   rV   rW   r   s	   &&&$     r   match_filesPathSpec.match_files  so     4 
e			VE9$89	::'6,ii49%%l>?7kGg
O s   A.A?5
A?c                   < V ^8  d   QhRS[ RS[S[S[.R3,          ,          RS[S[,          RS[S[,          RS[S[,          /# r   rf   rg   Nrh   ry   r   )r   r   r   ri   r-   r   r   )r   r   s   "r   r    r!   B  sZ     !8 !8!8 Xwio./!8 	!8 4.!8 y!8r"   c             #  v   "   \         P                  ! WVR7      pV P                  WTR7       Rj  xL
  R#  L5i)a  
Walks the specified root path for all files and matches them to this
path-spec.

*root* (:class:`str` or :class:`os.PathLike`) is the root directory to
search.

*on_error* (:class:`~collections.abc.Callable` or :data:`None`) optionally
is the error handler for file-system exceptions. It will be called with the
exception (:exc:`OSError`). Reraise the exception to abort the walk. Default
is :data:`None` to ignore file-system exceptions.

*follow_links* (:class:`bool` or :data:`None`) optionally is whether to walk
symbolic links that resolve to directories. Default is :data:`None` for
:data:`True`.

*negate* (:class:`bool` or :data:`None`) is whether to negate the match
results of the patterns. If :data:`True`, a pattern matching a file will
exclude the file rather than include it. Default is :data:`None` for
:data:`False`.

Returns the matched files (:class:`~collections.abc.Iterator` of
:class:`.TreeEntry`).
rk   ry   N)r   iter_tree_entriesr   )r'   rf   rg   rh   ry   r{   s   &&&&$ r   match_tree_entriesPathSpec.match_tree_entriesB  s1     @ ""4V'777   .979c                   < V ^8  d   QhRS[ RS[S[S[.R3,          ,          RS[S[,          RS[S[,          RS[S[,          /# r   )r   r   r   ri   r-   r   rR   )r   r   s   "r   r    r!   e  sY     !4 !4!4 Xwio./!4 	!4 4.!4 sm!4r"   c             #  v   "   \         P                  ! WVR7      pV P                  WTR7       Rj  xL
  R#  L5i)a  
Walks the specified root path for all files and matches them to this
path-spec.

*root* (:class:`str` or :class:`os.PathLike`) is the root directory to
search for files.

*on_error* (:class:`~collections.abc.Callable` or :data:`None`) optionally
is the error handler for file-system exceptions. It will be called with the
exception (:exc:`OSError`). Reraise the exception to abort the walk. Default
is :data:`None` to ignore file-system exceptions.

*follow_links* (:class:`bool` or :data:`None`) optionally is whether to walk
symbolic links that resolve to directories. Default is :data:`None` for
:data:`True`.

*negate* (:class:`bool` or :data:`None`) is whether to negate the match
results of the patterns. If :data:`True`, a pattern matching a file will
exclude the file rather than include it. Default is :data:`None` for
:data:`False`.

Returns the matched files (:class:`~collections.abc.Iterable` of
:class:`str`).
rk   r   N)r   rl   r   )r'   rf   rg   rh   ry   r\   s   &&&&$ r   match_tree_filesPathSpec.match_tree_filese  s1     @ 

t\
R%e333r   )r   r0   )NN)__name__
__module____qualname____firstlineno____doc__r(   r:   r@   rH   rL   rY   rc   rm   classmethodrw   r   staticmethodr   check_match_filerT   r   r   r   r   
match_tree__static_attributes____classdictcell__)r   s   @r   r   r   '   s     
  	 	  	 	+ +*0 08% %B  @%
  % %N D112 *&
  & &P!8  !8 !8F!4  !4 !4J r"   N)r   collections.abcr   r%   	itertoolsr   typingr   r   r   r   r   r	   r
   r    r   patternr   r   r   r   r   r   r   r   r   r,   r   r1   r"   r   <module>r      s]   	 	 	 
   vZ(cv cr"   