§
    ïyIf  ã                   ó¦   — d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZmZ ddlmZ  edd	¬
¦  «        Z	  G d„ d	e¦  «        ZdS )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                   óê  ‡ — e Zd ZdZdedefˆ fd„Zeede	e
         deeeegef         f         dee         de
fd„¦   «         ¦   «         Zee	 dde	e
         dee         deeeegef         d	f         de
fd
„¦   «         ¦   «         Ze	 dde	e
         dee         deeeegef         d	f         de
fˆ fd„¦   «         Zedeeeef                  dedeee         ee         f         fd„¦   «         Zˆ xZS )r   zu
	The :class:`GitIgnoreSpec` class extends :class:`pathspec.pathspec.PathSpec` to
	replicate *.gitignore* behavior.
	ÚotherÚreturnc                 ó¬   •— t          |t          ¦  «        r!t          ¦   «                              |¦  «        S t          |t          ¦  «        rdS t
          S )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     €úF/var/www/piapp/venv/lib/python3.11/site-packages/pathspec/gitignore.pyr   zGitIgnoreSpec.__eq__)   sJ   ø€ õ �•}Ñ%Ô%ð Ý
‰'Œ'�.Š.˜Ñ
Ô
ÐÝ�%�Ñ"Ô"ð Ø
ˆ%å
Ðó    ÚclsÚpattern_factoryÚlinesc                 ó   — d S ©N© )r"   r#   r$   s      r    Ú
from_lineszGitIgnoreSpec.from_lines7   ó	   € ð €#r!   Nc                 ó   — d S r&   r'   )r"   r$   r#   s      r    r(   zGitIgnoreSpec.from_lines@   r)   r!   c                 ó  •— |€t           }n>t          |t          t          f¦  «        st	          |¦  «        rt          |¦  «        r||}}t          ¦   «                              ||¦  «        }t          t          |¦  «        S )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(   zGitIgnoreSpec.from_linesI   sv   ø€ ð. ÐÝ(€?€?å�5�3¥˜,Ñ'Ô'ð 3­8°E©?¬?ð 3ÅÈ_Ñ@]Ô@]ð 3à! ?�E€?å	‰Œ×	Ò	˜O¨UÑ	3Ô	3€$Ý	�d�DÑ	Ô	Ðr!   ÚpatternsÚfilec                 ó  — d}d}d}| D ]�\  }}|j         �u|                     |¦  «        }|�^|j                             ¦   «                              t
          ¦  «        }|rd}	nd}	|j         r|r|j         }|}|	}Œp|	|k    r|j         }|}|	}Œ‚||fS )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   )
r/   r0   Úout_includeÚ	out_indexÚout_priorityÚindexÚpatternr5   Údir_markÚprioritys
             r    Ú_match_filezGitIgnoreSpec._match_filej   sÌ   € ð. !%€+Ø!€)Ø€,Ø ð ð �n€eˆWØ„oÐ!Ø×Ò˜tÑ$Ô$€EØÐð ”×%Ò%Ñ'Ô'×+Ò+­IÑ6Ô6€Xàð à€h€hð €hàŒð ˜Hð Ø”O€kØ€iØ€l€lØ
�lÒ
"Ð
"Ø”O€kØ€iØ€løà	�iÐ	Ðr!   r&   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚobjectÚboolr   r   Úclassmethodr   r   r
   r,   r   r   r   r   r(   Ústaticmethodr   Úintr   r   r?   Ú__classcell__)r   s   @r    r   r   #   s  ø€ € € € € ðð ð
˜ð  Dð ð ð ð ð ð ð ØðØˆD„zðà˜˜h¨ x°Ð'8Ô9Ð9Ô:ðð 
�&Ô	ðð ð	ð ð ñ „+ñ „(ðð Øð DHðð ØˆD„zðà	�&Ô	ðð ˜˜h¨ x°Ð'8Ô9¸4Ð?Ô@ðð ð	ð ð ñ „+ñ „(ðð ð DHðð ØˆD„zðà	�&Ô	ðð ˜˜h¨ x°Ð'8Ô9¸4Ð?Ô@ðð ð	ð ð ð ð ñ „+ðð@ ð2 Ø�U˜3Ð 3Ð3Ô4Ô5ð2 àð2 ð ˆH�TŒN˜H SœMÐ)Ô*ð2 ð 2 ð 2 ñ „,ð2 ð 2 ð 2 ð 2 ð 2 r!   N)rC   Útypingr   r   r   r   r   r   r	   r
   r   r   Úpathspecr   r<   r   Úpatterns.gitwildmatchr   r   Úutilr   r   r   r'   r!   r    ú<module>rN      sb  ððð ð

ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ðð ð ð ð ð ð
ð 
ð 
ð 
ð 
ð 
ðð ð ð ð ð ð ð ðð ð ð ð ð ð €wˆv˜_Ð-Ñ-Ô-€ððz ð z ð z ð z ð z �Hñ z ô z ð z ð z ð z r!   