intellecton/venv/lib/python3.12/site-packages/pathspec/__pycache__/pattern.cpython-312.pyc

125 lines
8.4 KiB
Text
Raw Normal View History

<EFBFBD>
J<>je<00><01><><00>dZddlmZddlZddlmZmZddlmZddl m
Z
m Z m Z m Z ddlmZmZmZe d d
<EFBFBD> <0B>Z Gd <0C>d e<13>ZGd<0E>d
e<14>Ze<08>Gd<0F>de<13><00>Zy)z8
This module provides the base definition for patterns.
<EFBFBD>)<01> annotationsN)<02>Iterable<6C>Iterator)<01> dataclass)<04>Any<6E>Optional<61>TypeVar<61>Union<6F>)<03>AnyStr<74>
deprecated<EFBFBD>override<64>RegexPatternSelf<6C> RegexPattern)<01>boundc<01>B<00>eZdZdZdZdd<03>Zed<04>d d<05><04>Zd
d<06>Zy) <0B>PatternzG
The :class:`Pattern` class is the abstract definition of a pattern.
<09><01>includec<01><00>||_y)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)<02>selfrs <20>S/home/antigravity/intellecton/venv/lib/python3.12/site-packages/pathspec/pattern.py<70>__init__zPattern.__init__'s<00><00><19>$<24>,<2C><06>zXPattern.match() is deprecated. Use Pattern.match_file() with a loop for similar results.c#<01>FK<00>|D]}|j|<02><00><01>|<02><01><00>y<01>w)a<>
.. version-deprecated:: 0.10.0
This method is no longer used. Use the :meth:`self.match_file <.Pattern.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.
Returns an :class:`~collections.abc.Iterable` yielding each matched file
path (:class:`str`).
N)<01>
match_file)r<00>files<65>files r<00>matchz Pattern.match7s+<00><00><><00>$<14><0F>d<EFBFBD>
<EFBFBD>o<EFBFBD>o<EFBFBD>d<EFBFBD><1B>'<27>
<0E>J<EFBFBD><0F>s<00>!<01>!c<01>L<00>tdj|j<00><02><00><00>)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().)<01>cls)<03>NotImplementedError<6F>format<61> __class__)rrs rrzPattern.match_fileMs$<00><00> <1C>D<>
<EFBFBD>F<EFBFBD>t<EFBFBD>~<7E>~<7E>F<EFBFBD><1E> <20> rN)r<00>Optional[bool]<5D>return<72>None)rz Iterable[str]r&z Iterator[str])r<00>strr&z Optional[Any]) <09>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F> __slots__rr rr<00>rrrrs6<00><00><05>
<03><19><06>  <0A><15><04><0F> <04><0F>$
 rrc<01><><00><00>eZdZdZdZ d
d <0B>fd<03> Zd d<04>Zd d<05>Zd d<06>Zdd<07>Z e
dd<08><04>Z e dd <09><04>Z <0A>xZS)rza
The :class:`RegexPattern` class is an implementation of a pattern using
regular expressions.
)<02>pattern<72>regexc<01>v<00><01>d}t|ttf<02>rL|<02>Jd|<02>d|<01>d<04><05><00>|j|<01>\}}|<02>X|<04>Jd|<04>d|<02>d<07><05><00>t j
|<04>}n2|<01>t |d<08>r|}n!|<01>|<02>Jd|<02>d|<01>d <09><05><00>td
|<01>d <0B><03><00>tt|<00>+|<02>||_ ||_ y) 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.
Nzinclude=z must be null when pattern=z is a string.z
raw_regex=z must be non-null when include=z is not None.rz is null.zpattern=z& is not a string, re.Pattern, or None.) <0A>
isinstancer(<00>bytes<65>pattern_to_regex<65>re<72>compile<6C>hasattr<74> TypeError<6F>superrrr0r1)rr0rr1<00> raw_regexr$s <20>rrzRegexPattern.__init__fs<00><><00>$!%<25>%<25><0F><07>#<23>u<EFBFBD><1C>&<26>
<11>/<2F><05><0F>w<EFBFBD>l<EFBFBD>.<2E>g<EFBFBD>\<5C><1D>?<3F><05>/<2F><1D>-<2D>-<2D>g<EFBFBD>6<><15>9<EFBFBD>g<EFBFBD><0E><19> <14> <20><06><12> <09>~<7E>5<>W<EFBFBD>L<EFBFBD> <0A>F<><06> <20> <0F>J<EFBFBD>J<EFBFBD>y<EFBFBD> !<21>E<EFBFBD><0E><1A>w<EFBFBD>w<EFBFBD><07>8<> <13>5<EFBFBD><0E><EFBFBD> <12>/<2F><05><0F>w<EFBFBD>l<EFBFBD>.<2E>g<EFBFBD>\<5C><19>;<3B><05>/<2F>
<13>h<EFBFBD>g<EFBFBD>\<5C>!G<>H<> I<>I<><07> <0C>d<EFBFBD>$<24>W<EFBFBD>-<2D>6=<3D>$<24>,<2C><06>
&+<2B>$<24>*<2A>rc<01>h<00>|jj<00>d|j<00>d|j<00>d<03>S)z;
Returns a debug representation of this regex pattern.
z (pattern=z
, include=<3D>))r$r)r0r<00>rs r<00>__repr__zRegexPattern.__repr__<5F>s3<00><00> <11>N<EFBFBD>N<EFBFBD> #<23> #<23> $<24>I<EFBFBD>d<EFBFBD>l<EFBFBD>l<EFBFBD>-=<3D>Z<EFBFBD><04> <0C> <0C>GW<47>WX<57> Y<>Yrc<01>4<00>t|jxsd<01>S)z<>
Returns a string representation of this regex pattern. Equivalent to uncompiled pattern.
The string representation is the uncompiled pattern if it is not
:data:`None`; otherwise, an empty string.
<09>)r(r0r>s r<00>__str__zRegexPattern.__str__<5F>s<00><00>
<0A>T<EFBFBD>\<5C>\<5C> <1F>R<EFBFBD> <20> rc<01>t<00>|j|j|j<00>}|j|_|S)zZ
Performa a shallow copy of the pattern.
Returns the copy (:class:`RegexPattern`).
)r$r1rr0<00>r<00>others r<00>__copy__zRegexPattern.__copy__<5F>s,<00><00> <0F>.<2E>.<2E><14><1A><1A>T<EFBFBD>\<5C>\<5C>
2<EFBFBD>%<25><16>,<2C>,<2C>%<25>-<2D> <0E>,rc<01><><00>t|t<00>r4|j|jk(xr|j|jk(StS)z<>
Tests the equality of this regex pattern with *other* (:class:`RegexPattern`)
by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex`
attributes.
)r3rrr1<00>NotImplementedrDs r<00>__eq__zRegexPattern.__eq__<5F>s9<00><00> <10><05>|<7C>$<24>
<0E>,<2C>,<2C>%<25>-<2D>-<2D>
'<27>
E<EFBFBD>D<EFBFBD>J<EFBFBD>J<EFBFBD>%<25>+<2B>+<2B>,E<>E<>
<18>rc<01>\<00>|jx}<02>|j|<01>x}<03> t|<03>Sy)a
Matches this pattern against the specified file.
*file* (:class:`str` or :class:`bytes`) is the file path relative to the
root directory (e.g., "relative/path/to/file").
Returns the match result (:class:`.RegexMatchResult`) if *file* matched;
otherwise, :data:`None`.
N)r1<00>search<63>RegexMatchResult)rrr1rs rrzRegexPattern.match_file<6C>s5<00><00><12>Z<EFBFBD>Z<EFBFBD><17>E<EFBFBD>$<24><16><1C><1C>d<EFBFBD>#<23>#<23><05>0<>
<1A>5<EFBFBD>
!<21>!<21> rc<01>
<00>|dfS)aF
Convert the pattern into an uncompiled regular expression.
*pattern* (:class:`str` or :class:`bytes`) is the pattern to convert into a
regular expression.
Returns a :class:`tuple` containing:
- *pattern* (:class:`str`, :class:`bytes` or :data:`None`) is the
uncompiled regular expression .
- *include* (:class:`bool` or :data:`None`) is 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!r0s rr5zRegexPattern.pattern_to_regex<65>s<00><00>. <12>4<EFBFBD><1F>r)N)r0zUnion[AnyStr, re.Pattern, None]rr%r&r')r&r()rrr&r)rE<00>objectr&<00>bool)rr r&zOptional[RegexMatchResult])r0r r&z'tuple[Optional[AnyStr], Optional[bool]])r)r*r+r,r-rr?rBrFrIrr<00> classmethodr5<00> __classcell__)r$s@rrrZs<><00><><00><05> <03><19>!<21>;<06> *<2A>;<06> <1A>;<06> <0B> ;<06>zZ<01> !<21><0F> <19> <0B><0E> <0B><0E>$<0E><19> <11><19>.<2E><19><0E>rc<01> <00>eZdZUdZdZded<y)rLzq
The :class:`RegexMatchResult` data class is used to return information about
the matched regular expression.
)rzre.MatchrN)r)r*r+r,r-<00>__annotations__r.rrrLrL<00>s<00><00><05> <03><19> <11><1F>rrL)r,<00>
__future__rr6<00>collections.abcrr<00> dataclassesr<00>typingrrr r
<00>_typingr r rrrNrrrLr.rr<00><module>rYs~<00><01><04>#<23> <09> <0B> <0C><08><08>  <0B> <0B>
<1B>-<2D>^<5E>D<><10><04>
: <20>f<EFBFBD>: <20>zW<19>7<EFBFBD>W<19>t <0B><1B><05>v<EFBFBD><05> <0A>r