§
    ïyIf~  ã                   óÌ   — d Z ddlZddlZddlZddlmZmZmZmZm	Z
mZmZmZmZ  G d„ de¦  «        Z G d„ de¦  «        Z ej        ¦   «          G d„ d	e¦  «        ¦   «         ZdS )
z8
This module provides the base definition for patterns.
é    N)	ÚAnyÚAnyStrÚIterableÚIteratorÚMatchÚOptionalÚPatternÚTupleÚUnionc                   óv   — e Zd ZdZdZdee         ddfd„Zdee	         de
e	         fd„Zd	e	dee         fd
„ZdS )r	   zG
	The :class:`Pattern` class is the abstract definition of a pattern.
	©Úincluder   ÚreturnNc                 ó   — || _         dS )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     úD/var/www/piapp/venv/lib/python3.11/site-packages/pathspec/pattern.pyÚ__init__zPattern.__init__   s   € ð €$„,ðð ó    Úfilesc              #   ó°   K  — t          j        d                     | j        ¬¦  «        t          d¬¦  «         |D ]}|                      |¦  «        �|V — ŒdS )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   ÚmatchzPattern.match.   sy   è è € õ „-ð÷ ‚FˆtŒ~€FÑÔÕ 2¸qð	Bñ Bô Bð Bð ð ð €dØ
‡o‚o�dÑÔÐ'Ø
€J€J€Jøðð r   r!   c                 óR   — t          d                     | j        ¬¦  «        ¦  «        ‚)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    zPattern.match_fileF   s*   € õ 	ØDß
‚FˆtŒ~€FÑÔñ	 ô 	 ð  r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úboolr   r   Ústrr   r"   r   r    © r   r   r	   r	      s›   € € € € € ðð ð
€ð˜X dœ^ð °ð ð ð ð ð ˜ œð ¨(°3¬-ð ð ð ð ð0
 ˜Cð 
  H¨S¤Mð 
 ð 
 ð 
 ð 
 ð 
 ð 
 r   r	   c                   ó²   ‡ — e Zd ZdZdZ	 ddeeedf         dee	         ddfˆ fd„Z
dd de	fd	„Zd
eded         fd„Zededeee	f         fd„¦   «         Zˆ xZS )ÚRegexPatternza
	The :class:`RegexPattern` class is an implementation of a pattern using
	regular expressions.
	)ÚpatternÚregexNr/   r   r   c                 ó®  •— t          |t          t          f¦  «        rB|�J d|›d|›d�¦   «         ‚|                      |¦  «        \  }}|�t	          j        |¦  «        }n>|�t          |d¦  «        r|}n)|€|�J d|›d|›d�¦   «         ‚nt          d|›d�¦  «        ‚t          t          | ¦  «         
                    |¦  «         || _        	 || _        dS )	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.)Ú
isinstancer+   ÚbytesÚpattern_to_regexÚreÚcompileÚhasattrÚ	TypeErrorÚsuperr.   r   r/   r0   )r   r/   r   r0   r   s       €r   r   zRegexPattern.__init___   s  ø€ õ& ��#�u˜Ñ&Ô&ð QØ
ˆ/ˆ/ØMˆwÐMÐM°WÐMÐMÐMñ Œ/ˆ/ð ×)Ò)¨'Ñ2Ô2�>€5ˆ'ð ÐÝŒJ�uÑÔ€EøàÐ�w w°Ñ8Ô8Ðð €5€5à€ð ˆ/ˆ/ØIˆwÐIÐI°WÐIÐIÐIñ Œ/ˆ/ˆ/õ
 
ÐO˜gÐOÐOÐOÑ	PÔ	PÐPå��dÑÔ×$Ò$ WÑ-Ô-Ð-à3:€$„,ðð
 "€$„*ðð r   Úotherc                 óz   — t          |t          ¦  «        r | j        |j        k    o| j        |j        k    S t          S )z¯
		Tests the equality of this regex pattern with *other* (:class:`RegexPattern`)
		by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex`
		attributes.
		)r2   r.   r   r0   ÚNotImplemented)r   r:   s     r   Ú__eq__zRegexPattern.__eq__˜   s9   € õ �•|Ñ$Ô$ð Ø
Œ,˜%œ-Ò
'Ð
E¨D¬J¸%¼+Ò,EÐEå
Ðr   r!   ÚRegexMatchResultc                 ój   — | j         �+| j                             |¦  «        }|�t          |¦  «        S dS )a  
		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   r0   r"   r>   )r   r!   r"   s      r   r    zRegexPattern.match_file£   s:   € ð 
„\ÐØŒ:×Ò˜DÑ!Ô!€5ØÐÝ˜EÑ"Ô"Ð"à	ˆr   c                 ó
   — |dfS )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`.
		Tr,   )r   r/   s     r   r4   zRegexPattern.pattern_to_regex´   s   € ð 
�$ˆÐr   )N)r%   r&   r'   r(   r)   r   r   ÚPatternHintr   r*   r   r=   r+   r    Úclassmethodr
   r4   Ú__classcell__)r   s   @r   r.   r.   S   s  ø€ € € € € ðð ð€ð !ð7ð 7à�˜ dÐ*Ô+ð7ð �DŒ>ð7ð ð	7ð 7ð 7ð 7ð 7ð 7ðr	˜ð 	¨Dð 	ð 	ð 	ð 	ð˜Cð  HÐ-?Ô$@ð ð ð ð ð" ð Cð ¨E°#°t°)Ô,<ð ð ð ñ „+ðð ð ð ð r   r.   c                   ó"   — e Zd ZU dZdZeed<   dS )r>   zq
	The :class:`RegexMatchResult` data class is used to return information about
	the matched regular expression.
	)r"   r"   N)r%   r&   r'   r(   r)   Ú	MatchHintÚ__annotations__r,   r   r   r>   r>   Æ   s5   € € € € € € ðð ð€ð 	ÐÐÑðð r   r>   )r(   Údataclassesr5   r   Útypingr   r   r   r   r   rE   r   r	   rA   r
   r   Úobjectr.   Ú	dataclassr>   r,   r   r   ú<module>rK      sG  ððð ð Ð Ð Ð Ø 	€	€	€	Ø €€€ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð< ð < ð < ð < ð < ˆfñ < ô < ð < ð~pð pð pð pð p�7ñ pô pð pðf €ÔÑÔðð ð ð ð �vñ ô ñ Ôðð ð r   