ó
    ßÅŸgÙ3  ã                   ó®   • S r SSKJr  SSKJr  SSK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JrJrJrJrJr  \" S	S
S9r  " S S
\5      rg)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                   óò  • \ rS rSrSrS\\   SS4S jrS\S\	4S jr
S\4S	 jrS
\SS S\4S jrS
\SS S\4S jr S#S\S\\\      S\\   4S jjr S#S\\   S\\\      S\\\      4S jjr  S$S\S\\\/S4      S\\	   S\\\      4S jjr\S\\   S\\\\/\4   4   S\\   S\4S j5       r  S#SS.S\\!   S\\\      S\\	   S\\!   4S jjjr"\#" \$RJ                  5      r&  S#S\S\\\      S\	4S jjr' S#SS.S\\   S\\\      S\\	   S\\   4S jjjr(  S$SS.S\S\\\/S4      S\\	   S\\	   S\\!   4
S  jjjr)  S$SS.S\S\\\/S4      S\\	   S\\	   S\\   4
S! jjjr*\*r+S"r,g)%r   é'   za
The :class:`PathSpec` class is a wrapper around a list of compiled
:class:`.Pattern` instances.
ÚpatternsÚreturnNc                 óP   • [        U[        5      (       d  [        U5      nXl        g)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/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/pathspec/pathspec.pyÚ__init__ÚPathSpec.__init__-   s$   € ô 
�Hœn×	-Ñ	-Ü�8‹n€8à'/„-ðó    Úotherc                 óœ   • [        U[        5      (       a2  [        U R                  UR                  5      n[	        S U 5       5      $ [
        $ )z�
Tests the equality of this path-spec with *other* (:class:`PathSpec`)
by comparing their :attr:`~PathSpec.patterns` attributes.
c              3   ó,   #   • U H  u  pX:H  v •  M     g 7f©N© )Ú.0ÚaÚbs      r#   Ú	<genexpr>Ú"PathSpec.__eq__.<locals>.<genexpr>D   s   é € Ð1¡™˜ˆaŽf¢ùs   ‚)r   r   r   r   ÚallÚNotImplemented)r"   r'   Úpaired_patternss      r#   Ú__eq__ÚPathSpec.__eq__=   s<   € ô
 �”x× Ñ Ü  §¡°·±Ó?€?Ü
Ñ1¡Ó1Ó
1Ð1ä
Ðr&   c                 ó,   • [        U R                  5      $ )zQ
Returns the number of compiled patterns this path-spec contains
(:class:`int`).
)Úlenr   )r"   s    r#   Ú__len__ÚPathSpec.__len__H   s   € ô
 
ˆT�]‰]Ó	Ðr&   r"   c                 óˆ   • [        U[        5      (       a(  U R                  U R                  UR                  -   5      $ [        $ )zW
Combines the :attr:`Pathspec.patterns` patterns from two
:class:`PathSpec` instances.
)r   r   Ú	__class__r   r2   ©r"   r'   s     r#   Ú__add__ÚPathSpec.__add__O   s3   € ô
 �”x× Ñ Ø
�.‰.˜Ÿ™¨¯©Ñ7Ó
8Ð8ä
Ðr&   c                 óz   • [        U[        5      (       a!  U =R                  UR                  -  sl        U $ [        $ )zc
Adds the :attr:`Pathspec.patterns` patterns from one :class:`PathSpec`
instance to this instance.
)r   r   r   r2   r<   s     r#   Ú__iadd__ÚPathSpec.__iadd__Y   s.   € ô
 �”x× Ñ Ø‡=‚=�E—N‘NÑ"…=Ø
€;ä
Ðr&   ÚfileÚ
separatorsc                 ó~   • [        X5      nU R                  [        U R                  5      U5      u  pE[	        XU5      $ )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"   rB   rC   Ú	norm_fileÚincludeÚindexs         r#   Ú
check_fileÚPathSpec.check_filed   s8   € ô" ˜TÓ.€)Ø×#Ñ#¤I¨d¯m©mÓ$<¸iÓH�.€'Ü	�T EÓ	*Ð*r&   Úfilesc              #   óà   #   • [        U5      (       d  [        SU< S35      e[        U R                  5      nU H/  n[	        XB5      nU R                  X55      u  pg[        XFU5      v •  M1     g7f)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   rE   r   )r"   rL   rC   Úuse_patternsÚ	orig_filerG   rH   rI   s           r#   Úcheck_filesÚPathSpec.check_filesy   sh   é € ô& 
�e×	Ñ	Ü	�V˜E™9Ð$8Ð9Ó	:Ð:ä'¨¯©Ó6€,Û€iÜ˜iÓ4€9Ø×$Ñ$ \Ó=�>€7Ü	�Y¨Ó	/Ô/ò ùs   ‚A,A.ÚrootÚon_errorÚfollow_linksc              #   ól   #   • [         R                  " XUS9nU R                  U5       Sh  v•N   g N7f)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`).
©rV   rW   N)r   Úiter_tree_filesrS   )r"   rU   rV   rW   rL   s        r#   Úcheck_tree_filesÚPathSpec.check_tree_files•   s-   é € ô< ×
Ò
˜tÀ\Ñ
R€%Ø×Ñ˜eÓ$×$Ó$ùs   ‚*4¬2­4ÚclsÚpattern_factoryÚlinesc                 ó0  • [        U[        5      (       a  [        R                  " U5      n[	        U5      (       d  [        SU< S35      e[        U5      (       d  [        SU< S35      eU Vs/ sH  o3(       d  M  U" U5      PM     nnU " U5      $ s  snf )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:rO   )r   Ústrr   Úlookup_patternÚcallablerP   r   )r]   r^   r_   Úliner   s        r#   Ú
from_linesÚPathSpec.from_lines¶   s�   € ô* �¤×%Ñ%Ü×(Ò(¨Ó9€?ä	�/×	"Ñ	"Ü	Ð% oÑ%8Ð8IÐJÓ	KÐKä	�e×	Ñ	Ü	�V˜E™9Ð$8Ð9Ó	:Ð:á05Ó>±¨»Ó#‰o˜dÖ#±€(Ð>Ù	ˆX‹Ðùò ?s   Á0	BÁ=B©ÚnegateÚentriesrh   c             #   ó  #   • [        U5      (       d  [        SU< S35      e[        U R                  5      nU HG  n[	        UR
                  U5      nU R                  XF5      u  pxU(       a  U(       + nU(       d  MC  Uv •  MI     g7f)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:rO   N)r   rP   r   r   r   ÚpathrE   )	r"   ri   rC   rh   rQ   ÚentryrG   rH   Ú_indexs	            r#   Úmatch_entriesÚPathSpec.match_entries×   su   é € ô2 
�g×	Ñ	Ü	�X˜g™[Ð(<Ð=Ó	>Ð>ä'¨¯©Ó6€,Û€eÜ˜eŸj™j¨*Ó5€9Ø×%Ñ% lÓ>�?€7æØŒk€Gç€gØ
„Kò ùs   ‚A7BÁ=	Bc                 ó|   • [        X5      nU R                  [        U R                  5      U5      u  pE[	        U5      $ )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   rE   rF   r   Úbool)r"   rB   rC   rG   rH   rm   s         r#   Ú
match_fileÚPathSpec.match_file  s5   € ô" ˜TÓ.€)Ø×$Ñ$¤Y¨t¯}©}Ó%=¸yÓI�/€'Ü	ˆg‹Ðr&   c             #   óú   #   • [        U5      (       d  [        SU< S35      e[        U R                  5      nU H<  n[	        XR5      nU R                  XF5      u  pxU(       a  U(       + nU(       d  M8  Uv •  M>     g7f)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`).
rN   rO   N)r   rP   r   r   r   rE   )	r"   rL   rC   rh   rQ   rR   rG   rH   rm   s	            r#   Úmatch_filesÚPathSpec.match_files  so   é € ô4 
�e×	Ñ	Ü	�V˜E™9Ð$8Ð9Ó	:Ð:ä'¨¯©Ó6€,Û€iÜ˜iÓ4€9Ø×%Ñ% lÓ>�?€7æØŒk€Gç€gØ
„Oò ùs   ‚A,A;Á2	A;c             #   óh   #   • [         R                  " XUS9nU R                  XTS9 Sh  v•N   g N7f)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`).
rY   rg   N)r   Úiter_tree_entriesrn   )r"   rU   rV   rW   rh   ri   s         r#   Úmatch_tree_entriesÚPathSpec.match_tree_entriesB  s1   é € ô@ ×"Ò" 4ÈÑV€'Ø×Ñ ÐÐ7×7Ó7ùó   ‚(2ª0«2c             #   óh   #   • [         R                  " XUS9nU R                  XTS9 Sh  v•N   g N7f)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`).
rY   rg   N)r   rZ   ru   )r"   rU   rV   rW   rh   rL   s         r#   Úmatch_tree_filesÚPathSpec.match_tree_filese  s1   é € ô@ ×
Ò
˜tÀ\Ñ
R€%Ø×Ñ˜eÐÐ3×3Ó3ùr{   )r   r*   )NN)-Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r$   Úobjectrq   r4   Úintr8   r   r=   r@   r   r	   r   ra   r   rJ   r   rS   r   r   ÚOSErrorr[   Úclassmethodr
   r   r   re   r   rn   Ústaticmethodr   Úcheck_match_filerE   rr   ru   ry   r}   Ú
match_treeÚ__static_attributes__r+   r&   r#   r   r   '   sH  † ñð
˜h wÑ/ð °Dô ð 	˜ð 	 Dô 	ð�cô ð�4ð  
ð ¨tô ð	�Dð 	 ð 	°ô 	ð +/ñ+àð+ð �z #‘Ñ'ð+ð �(Ñõ	+ð0 +/ñ0à	�(Ñ	ð0ð �z #‘Ñ'ð0ð ˆ{˜8Ñ$Ñ%õ	0ð> 37Ø!%ñ	%àð%ð �X˜w˜i¨˜oÑ.Ñ/ð%ð ˜‘ð	%ð
 ˆ{˜3ÑÑ õ%ðB ðØˆD�zðà˜˜h¨ x°Ð'8Ñ9Ð9Ñ:ðð 
�&Ñ	ðð ó	ó ððF +/ð%ð
  ò%à�IÑð%ð �z #‘Ñ'ð%ð
 �4‰.ð%ð ˆyÑö%ñN ˜D×1Ñ1Ó2€ðð +/ñàðð �z #‘Ñ'ðð õ	ð0 +/ð&ð
  ò&à	�'Ñ	ð&ð �z #‘Ñ'ð&ð
 �4‰.ð&ð ˆwÑö&ðV 37Ø!%ð	!8ð  ò!8àð!8ð �X˜w˜i¨˜oÑ.Ñ/ð!8ð ˜‘ð	!8ð �4‰.ð!8ð ˆyÑö!8ðL 37Ø!%ð	!4ð  ò!4àð!4ð �X˜w˜i¨˜oÑ.Ñ/ð!4ð ˜‘ð	!4ð �4‰.ð!4ð ˆs�mö!4ðJ ƒ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   r+   r&   r#   Ú<module>r‘      s]   ðñõõ÷	÷ 	õ 	õ õ
÷÷ ñ ñ ˆv˜ZÑ(€ðôcˆvõ cr&   