§
    ® ni1  ã                   ón   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ  G d	„ d
e¦  «        ZdS )zÛ
This module provides the simple backend for :class:`~pathspec.gitignore.GitIgnoreSpec`.

WARNING: The *pathspec._backends.simple* package is not part of the public API.
Its contents and structure are likely to change.
é    )ÚSequence)ÚOptional)ÚRegexPattern)Ú	_DIR_MARK)Úoverrideé   )ÚSimplePsBackendc            	       óÐ   ‡ — e Zd ZU dZeeeef                  ed<   dddœde	e         de
e         de
e         ddfˆ fd	„Zed
edee
e         e
e         f         fd„¦   «         Zˆ xZS )ÚSimpleGiBackendz˜
	The :class:`SimpleGiBackend` class is the default (or simple) implementation
	used by :class:`~pathspec.gitignore.GitIgnoreSpec` for matching files.
	Ú	_patternsN©Ú	no_filterÚ
no_reverseÚpatternsr   r   Úreturnc                óP   •— t          ¦   «                              |||¬¦  «         dS )a„  
		Initialize the :class:`SimpleGiBackend` instance.

		*patterns* (:class:`Sequence` of :class:`.RegexPattern`) contains the
		compiled patterns.

		*no_filter* (:class:`bool`) is whether to keep no-op patterns (:data:`True`),
		or remove them (:data:`False`).

		*no_reverse* (:class:`bool`) is whether to keep the pattern order
		(:data:`True`), or reverse the order (:data:`True`).
		r   N)ÚsuperÚ__init__)Úselfr   r   r   Ú	__class__s       €ú`/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/pathspec/_backends/simple/gitignore.pyr   zSimpleGiBackend.__init__!   s*   ø€ õ& '„'×Ò8 y¸ZÐÑHÔHÐHÐHÐHó    Úfilec                 ó@  — | j         }d}d}d}| j        D ]†\  }}|j        x}x|                     |¦  «        x}	a|	j                             ¦   «                              t          ¦  «        }
|
rd}nd}|r||k    r|}|}|}n|r|
s||k    r|}|}|}|r|dk    r nŒ‡||fS )a  
		Check the file against the patterns.

		*file* (:class:`str`) is the normalized file path to check.

		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   é   )Ú_is_reversedr   ÚincludeÚ
match_fileÚmatchÚ	groupdictÚgetr   )r   r   Úis_reversedÚout_includeÚ	out_indexÚout_priorityÚindexÚpatternr   r   Údir_markÚprioritys               r   r   zSimpleGiBackend.match_file6   sÿ   € ð Ô!€+à $€+Ø!€)Ø€,Øœð  ð  n€eˆWà”Ð€WÐ,Ø×$Ò$ TÑ*Ô*Ð	*ˆÐ7ð
 Œ{×$Ò$Ñ&Ô&×*Ò*­9Ñ5Ô5€Hàð à€X€Xð €Xàð 
Ø<ÒÐØ€kØ€iØ€løð 
ð Xð  (¨lÒ":Ð":Ø€kØ€iØ€làð x 1’}}ð €Uøà
yÐ	!Ð!r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚlistÚtupleÚintr   Ú__annotations__r   r   Úboolr   r   Ústrr   Ú__classcell__)r   s   @r   r   r      s÷   ø€ € € € € € ðð ð s˜LÐ(Ô)Ô*Ð*Ð*Ñ*ð #Ø#ðIð Ið Ià\Ô"ðIð dŒ^ð	Ið
 tŒnðIð ðIð Ið Ið Ið Ið Ið* ð1"˜Cð 1" E¨(°4¬.¸(À3¼-Ð*GÔ$Hð 1"ð 1"ð 1"ñ „(ð1"ð 1"ð 1"ð 1"ð 1"r   r   N)r-   Úcollections.abcr   Útypingr   Úpathspec.patternr   Ú pathspec.patterns.gitignore.specr   Úpathspec._typingr   Úpathspecr	   r   © r   r   ú<module>r<      s  ððð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðP"ð P"ð P"ð P"ð P"oñ P"ô P"ð P"ð P"ð P"r   