Files
ServerSync/lib/pathspec/__pycache__/pathspec.cpython-314.pyc

281 lines
20 KiB
Plaintext
Raw Normal View History

2026-03-31 00:43:39 +03:00
+
k<><6B>i/;<00><01><><00>Rt^RIHt^RIHtHtHtHt^RIH t ^RI
H t H t H t HtHt] !RRR7t^RIHt^R IHtHt^R
IHt^R IHt^R IHtHt^R IHtHtH t H!t!H"t"H#t#!RR]$4t%R#)zn
This module provides :class:`.PathSpec` which is an object-oriented interface
for pattern matching of files.
)<01> annotations)<04>
Collection<EFBFBD>Iterable<6C>Iterator<6F>Sequence)<01> zip_longest)<05>Callable<6C>Optional<61>TypeVar<61>Union<6F>cast<73>Self<6C>PathSpec)<01>bound)<01>util)<02>_Backend<6E>BackendNamesHint<6E><01>make_pathspec_backend)<01>Pattern)<02>AnyStr<74>
deprecated)<06> CheckResult<6C>StrPath<74>TStrPath<74> TreeEntry<72> _is_iterable<6C>normalize_filec<01>\<00>]tRt^/tRtRRRR/RRlltRRltR R
ltR R ltR Rlt R(RRllt
R(RRllt R)RRllt ] RRRR/RRll4t]RRl4tR(RR/RRllltR(RRlltR(RR/RRllltR)RR/R R!lllt]!R"4R#R$l4tR)RR/R%R&llltR'tR#)*rza
The :class:`PathSpec` class is a wrapper around a list of compiled
:class:`.Pattern` instances.
<EFBFBD>backendN<64>_test_backend_factoryc<01>(<00>V^8<>dQhRRRRRRRR/#) <09><00>patternsz+Union[Sequence[Pattern], Iterable[Pattern]]r<00>"Union[BackendNamesHint, str, None]r <00>1Optional[Callable[[Sequence[Pattern]], _Backend]]<5D>return<72>None<6E>)<01>formats"<22>8/tmp/pip-target-9typod50/lib/python/pathspec/pathspec.py<70> __annotate__<5F>PathSpec.__annotate__5s3<00><00>.<06>.<06> 7<>.<06> .<2E> .<06>
K<01> .<06>  <0B> .<06>c <0A><><00>\V\4'g \V4pVfRp\\V4pVe
V!V4pMVP W!4pW@nW nWnR#)a
Initializes the :class:`.PathSpec` instance.
*patterns* (:class:`~collections.abc.Sequence` or :class:`~collections.abc.Iterable`)
contains each compiled pattern (:class:`.Pattern`). If not a sequence, it
will be converted to a :class:`list`.
*backend* (:class:`str` or :data:`None`) is the pattern (regular expression)
matching backend to use. Default is :data:`None` for "best" to use the best
available backend. Priority of backends is: "re2", "hyperscan", "simple".
The "simple" backend is always available.
N<EFBFBD>best) <09>
isinstancer<00>listr r<00> _make_backend<6E>_backend<6E> _backend_namer#)<05>selfr#rr <00> use_backends&&$$ r*<00>__init__<5F>PathSpec.__init__5st<00><00>&
<14>H<EFBFBD>h<EFBFBD> '<27> '<27><12>8<EFBFBD>n<EFBFBD>8<EFBFBD> <0C>_<EFBFBD> <13>7<EFBFBD> <10>!<21>7<EFBFBD> +<2B>'<27><1A>&<26>&<26>x<EFBFBD>0<>;<3B><15>#<23>#<23>G<EFBFBD>6<>;<3B>'<27>-<2D><06>
*1<><14><06>&.<2E>-<2D>r-c<01>$<00>V^8<>dQhRRRRRR/#<00>r"r5r <00>otherrr&r()r)s"r*r+r,es!<00><00><19><19>4<EFBFBD><19><08><19>T<EFBFBD>r-c <0A><><00>\V\4'd9VPVPVP,VPR7#\
#)zh
Combines the :attr:`self.patterns <.PathSpec.patterns>` patterns from two
:class:`PathSpec` instances.
)r)r0r<00> __class__r#r4<00>NotImplemented<65>r5r;s&&r*<00>__add__<5F>PathSpec.__add__es=<00><00>
<10><05>x<EFBFBD> <20> <20>
<0E>.<2E>.<2E><14><1D><1D><15><1E><1E>7<><14>AS<41>AS<41>.<2E>
T<EFBFBD>T<>
<18>r-c<01> <00>V^8<>dQhRRRR/#)r"r;<00>objectr&<00>boolr()r)s"r*r+r,os<00><00> <19> <19><16> <19>D<EFBFBD> r-c <0A><><00>\V\4'dU\VPVP4p\;QJdRV4F 'dK R# R#!RV44#\
#)z<>
Tests the equality of this path-spec with *other* (:class:`PathSpec`) by
comparing their :attr:`self.patterns <.PathSpec.patterns>` attributes.
c3<01>."<00>TF wrW8Hx<00>K R#5i<01>Nr()<03>.0<EFBFBD>a<>bs& r*<00> <genexpr><3E>"PathSpec.__eq__.<locals>.<genexpr>vs<00><00><00> 1<><1F><14><11>a<EFBFBD>f<EFBFBD><1F>s<00>FT)r0rrr#<00>allr>)r5r;<00>paired_patternss&& r*<00>__eq__<5F>PathSpec.__eq__osT<00><00>
<10><05>x<EFBFBD> <20> <20> <20><14><1D><1D><05><0E><0E>?<3F>?<3F>
<0A>#<23> 1<><1F> 1<>#<23>#<23>1<>#<23>1<>#<23> 1<><1F> 1<>
1<EFBFBD>1<>
<18>r-c<01>$<00>V^8<>dQhRRRRRR/#r:r()r)s"r*r+r,zs!<00><00>
<19>
<19>D<EFBFBD>
<19><18>
<19>d<EFBFBD>
r-c <0A><><00>\V\4'dQV;PVP, unVPVPVP4VnV#\ #)zh
Adds the :attr:`self.patterns <.PathSpec.patterns>` from *other*
(:class:`PathSpec`) to this instance.
)r0rr#r2r4r3r>r?s&&r*<00>__iadd__<5F>PathSpec.__iadd__zsL<00><00>
<10><05>x<EFBFBD> <20> <20><07>=<3D>=<3D>E<EFBFBD>N<EFBFBD>N<EFBFBD>"<22>=<3D><17>%<25>%<25>d<EFBFBD>&8<>&8<>$<24>-<2D>-<2D>H<>4<EFBFBD>=<3D>
<0E>;<3B>
<18>r-c<01><00>V^8<>dQhRR/#)r"r&<00>intr()r)s"r*r+r,<00>s<00><00><1C><1C>c<EFBFBD>r-c <0A>,<00>\VP4#)zj
Returns the number of :attr:`self.patterns <.PathSpec.patterns>` this
path-spec contains (:class:`int`).
)<02>lenr#)r5s&r*<00>__len__<5F>PathSpec.__len__<5F>s<00><00>
<0A>T<EFBFBD>]<5D>]<5D> <1B>r-c<01>$<00>V^8<>dQhRRRRRR/#)r"<00>filer<00>
separators<EFBFBD>Optional[Collection[str]]r&zCheckResult[TStrPath]r()r)s"r*r+r,<00>s(<00><00>+<2B>+<2B><10>+<2B>(<28>+<2B><1C> +r-c <0A>j<00>\W4pVPPV4wrE\WV4#)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:`.normalize_file` for more information.
Returns the file check result (:class:`.CheckResult`).
)rr3<00>
match_filer)r5r\r]<00> norm_file<6C>include<64>indexs&&& r*<00>
check_file<EFBFBD>PathSpec.check_file<6C>s1<00><00>"<1D>T<EFBFBD>.<2E>)<29><17>=<3D>=<3D>+<2B>+<2B>I<EFBFBD>6<>.<2E>'<27> <14>T<EFBFBD>E<EFBFBD> *<2A>*r-c<01>$<00>V^8<>dQhRRRRRR/#)r"<00>fileszIterable[TStrPath]r]r^r&zIterator[CheckResult[TStrPath]]r()r)s"r*r+r,<00>s(<00><00>0<>0<> <1B>0<>(<28>0<>&<26> 0r-c# <0A><>"<00>\V4'g\RV: R24hVF9p\W24pVPP V4wrV\ W5V4x<00>K; R#5i)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:`.normalize_file` for more information.
Returns an :class:`~collections.abc.Iterator` yielding each file check
result (:class:`.CheckResult`).
<EFBFBD>files:<3A> is not an iterable.N)r<00> TypeErrorrr3r`r)r5rgr]<00> orig_filerarbrcs&&& r*<00> check_files<65>PathSpec.check_files<65>s^<00><00><00>&
<16>e<EFBFBD> <1C> <1C> <12>V<EFBFBD>E<EFBFBD>9<EFBFBD>$8<>9<> :<3A>:<3A><18>i<EFBFBD><1D>i<EFBFBD>4<>9<EFBFBD><18>M<EFBFBD>M<EFBFBD>,<2C>,<2C>Y<EFBFBD>7<>><3E>7<EFBFBD> <14>Y<EFBFBD><15> /<2F>/<2F><19>s<00>A#A%c<01>(<00>V^8<>dQhRRRRRRRR/#) r"<00>rootr<00>on_error<6F>#Optional[Callable[[OSError], None]]<5D> follow_links<6B>Optional[bool]r&zIterator[CheckResult[str]]r()r)s"r*r+r,<00>s2<00><00>%<25>%<25><0F>%<25> 0<>%<25><1F> %<25>
!<21> %r-c# <0A>t"<00>\P!WVR7pVPV4Rjx<01>L
R#L5i)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:`.CheckResult`).
<EFBFBD>rqrsN)r<00>iter_tree_filesrm)r5rprqrsrgs&&&& r*<00>check_tree_files<65>PathSpec.check_tree_files<65>s-<00><00><00>< <0F>
<1E>
<1E>t<EFBFBD>\<5C>
R<EFBFBD>%<25> <11> <1D> <1D>e<EFBFBD> $<24>$<24>$<24>s <00>-8<01>6<04>8c <01>0<00>V^8<>dQhRRRRRRRRR R
R R /#) r"<00>clsz
type[Self]<5D>pattern_factoryz'Union[str, Callable[[AnyStr], Pattern]]<5D>lineszIterable[AnyStr]rr$r r%r&r r()r)s"r*r+r,<00>sM<00><00>&U<01>&U<01><11>&U<01>:<3A>&U<01>
<1A>&U<01>
.<2E> &U<01> K<01> &U<01> <0B>&Ur-c <0A><<00>\V\4'd\P!V4p\ V4'g\ RV: R24h\ V4'g\ RV: R24hVUu.uFqU'gK V!V4NK ppV!WcVR7#uupi)ad
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`.
*backend* (:class:`str` or :data:`None`) is the pattern (or regular
expression) matching backend to use. Default is :data:`None` for "best" to
use the best available backend. Priority of backends is: "re2", "hyperscan",
"simple". The "simple" backend is always available.
Returns the :class:`PathSpec` instance.
zpattern_factory:z is not callable.zlines:rj)rr )r0<00>strr<00>lookup_pattern<72>callablerkr)r{r|r}rr <00>liner#s&&&$$ r*<00>
from_lines<EFBFBD>PathSpec.from_lines<65>s<><00><00>:<10><0F><13>%<25>%<25><19>(<28>(<28><1F>9<>?<3F> <11>/<2F> "<22> "<22> <12>%<25>o<EFBFBD>%8<>8I<38>J<> K<>K<> <15>e<EFBFBD> <1C> <1C> <12>V<EFBFBD>E<EFBFBD>9<EFBFBD>$8<>9<> :<3A>:<3A>05<30> ><3E><05><04><14>#<23>o<EFBFBD>d<EFBFBD>#<23><05>(<28> ><3E> <0C>X<EFBFBD>>S<> T<>T<><54>?s <00>3 B<04> Bc<01>$<00>V^8<>dQhRRRRRR/#)r"<00>namerr#zSequence[Pattern]r&rr()r)s"r*r+r,s&<00><00>/<2F>/<2F><18>/<2F> <1D>/<2F><0F>/r-c <0A><00>\W4#)aD
.. warning:: This method is not part of the public API. It is subject to
change.
Create the backend for the patterns.
*name* (:class:`str`) is the name of the backend.
*patterns* (:class:`~collections.abc.Sequence` of :class:`.Pattern`)
contains the compiled patterns.
Returns the matcher (:class:`._Backend`).
r)r<>r#s&&r*r2<00>PathSpec._make_backends<00><00>$
<1F>t<EFBFBD> .<2E>.r-<00>negatec<01>(<00>V^8<>dQhRRRRRRRR/#) r"<00>entrieszIterable[TreeEntry]r]r^r<>rtr&<00>Iterator[TreeEntry]r()r)s"r*r+r,s2<00><00>$<10>$<10> <1E>$<10>(<28>$<10>
<19> $<10> <1A> $r-c# <0A>"<00>\V4'g\RV: R24hVFSp\VPV4pVPP V4wrgV'dV'*pV'gKOVx<00>KU R#5i)a<>
Matches the entries to this path-spec.
*entries* (:class:`~collections.abc.Iterable` of :class:`.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:`.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:`.TreeEntry`).
zentries:rjN)rrkr<00>pathr3r`)r5r<>r]r<><00>entryrarb<00>_indexs&&&$ r*<00> match_entries<65>PathSpec.match_entriessk<00><00><00>2
<16>g<EFBFBD> <1E> <1E> <12>X<EFBFBD>g<EFBFBD>[<5B>(<<3C>=<3D> ><3E>><3E><16>e<EFBFBD><1D>e<EFBFBD>j<EFBFBD>j<EFBFBD>*<2A>5<>9<EFBFBD><19>]<5D>]<5D>-<2D>-<2D>i<EFBFBD>8<>?<3F>7<EFBFBD> <0C><19>k<EFBFBD>G<EFBFBD> <0A>g<EFBFBD>
<0F>K<EFBFBD><17>s <00>A.A?<01>5
A?c<01>$<00>V^8<>dQhRRRRRR/#)r"r\rr]r^r&rDr()r)s"r*r+r,As(<00><00><17><17><0F><17>(<28><17> <0B> r-c <0A>h<00>\W4pVPPV4wrE\V4#)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:`.normalize_file` for more information.
Returns :data:`True` if *file* matched; otherwise, :data:`False`.
)rr3r`rD)r5r\r]rarbr<>s&&& r*r`<00>PathSpec.match_fileAs.<00><00>"<1D>T<EFBFBD>.<2E>)<29><18>M<EFBFBD>M<EFBFBD>,<2C>,<2C>Y<EFBFBD>7<>/<2F>'<27> <0A>g<EFBFBD><1D>r-c<01>(<00>V^8<>dQhRRRRRRRR/#) r"rgzIterable[StrPath]r]r^r<>rtr&zIterator[StrPath]r()r)s"r*r+r,Vs2<00><00>%<14>%<14> <1A>%<14>(<28>%<14>
<19> %<14> <18> %r-c# <0A><>"<00>\V4'g\RV: R24hVFHp\WB4pVPP V4wrgV'dV'*pV'gKDVx<00>KJ R#5i)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:`.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`).
rirjN)rrkrr3r`)r5rgr]r<>rlrarbr<>s&&&$ r*<00> match_files<65>PathSpec.match_filesVse<00><00><00>4
<16>e<EFBFBD> <1C> <1C> <12>V<EFBFBD>E<EFBFBD>9<EFBFBD>$8<>9<> :<3A>:<3A><18>i<EFBFBD><1D>i<EFBFBD>4<>9<EFBFBD><19>]<5D>]<5D>-<2D>-<2D>i<EFBFBD>8<>?<3F>7<EFBFBD> <0C><19>k<EFBFBD>G<EFBFBD> <0A>g<EFBFBD>
<13>O<EFBFBD><19>s <00>A#A4<01>*
A4c
<01>,<00>V^8<>dQhRRRRRRRRRR /#)
r"rprrqrrrsrtr<>r&r<>r()r)s"r*r+r,}s<<00><00>!8<>!8<><0F>!8<> 0<>!8<><1F> !8<> <19> !8<><1A>!8r-c# <0A>v"<00>\P!WVR7pVPWTR7Rjx<01>L
R#L5i)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`).
rv<00>r<>N)r<00>iter_tree_entriesr<73>)r5rprqrsr<>r<>s&&&&$ r*<00>match_tree_entries<65>PathSpec.match_tree_entries}s1<00><00><00>@ <11> "<22> "<22>4<EFBFBD><1C> V<>'<27> <11> <1F> <1F><07> <1F> 7<>7<>7<><37> <00>.9<01>7<04>9zEPathSpec.match_tree() is deprecated. Use .match_tree_files() instead.c<01><00>V^8<>dQhRR/#)r"r&<00> Iterator[str]r()r)s"r*r+r,<00>s<00><00>,<2C>,<2C>m<EFBFBD>,r-c <0A>&<00>VP!V/VB#)z<>
.. version-deprecated:: 0.3.2
This is an alias for the :meth:`self.match_tree_files <.PathSpec.match_tree_files>`
method.
)<01>match_tree_files)r5<00>args<67>kws&*,r*<00>
match_tree<EFBFBD>PathSpec.match_tree<65>s<00><00>
<0E> <1E> <1E><04> +<2B><02> +<2B>+r-c
<01>,<00>V^8<>dQhRRRRRRRRRR /#)
r"rprrqrrrsrtr<>r&r<>r()r)s"r*r+r,<00>s<<00><00> 4<> 4<><0F> 4<> 0<> 4<><1F> 4<> <19> 4<><14> 4r-c# <0A>v"<00>\P!WVR7pVPWTR7Rjx<01>L
R#L5i)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`).
rvr<>N)rrwr<>)r5rprqrsr<>rgs&&&&$ r*r<><00>PathSpec.match_tree_files<65>s0<00><00><00>> <0F>
<1E>
<1E>t<EFBFBD>\<5C>
R<EFBFBD>%<25> <11> <1D> <1D>e<EFBFBD> <1D> 3<>3<>3<>r<EFBFBD>)r3r4r#rG)NN)<19>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__r7r@rOrSrYrdrmrx<00> classmethodr<64><00> staticmethodr2r<>r`r<>r<>rr<>r<><00>__static_attributes__r(r-r*rr/s<><00><00><05>
.<06>15<31> .<06>
NR<01> .<06>`<19> <19>
<19><1C>+<2B>*0<>6%<25>B<0E>&U<01>
15<31> &U<01> NR<01> &U<01><0E>&U<01>P<0F>/<2F><0F>/<2F>&$<10>
 <20> $<10>$<10>L<17>*%<14>
 <20> %<14>%<14>N!8<>  <20> !8<>!8<>H <0A>I<><04>,<2C><04>,<2C> 4<>  <20> 4<> 4r-N)&r<><00>
__future__r<00>collections.abcrrrr<00> itertoolsr<00>typingrr r
r r r <00>pathspecr<00>pathspec.backendrr<00>pathspec._backends.aggr<00>pathspec.patternr<00>pathspec._typingrr<00> pathspec.utilrrrrrrrCrr(r-r*<00><module>r<>sl<00><01><04>#<23> <0B> <0B>
<0E><07><07><0F>v<EFBFBD>Z<EFBFBD>(<28><04><04>
<1A><13><18>
<EFBFBD> <0A><11><11>]4<>v<EFBFBD>]4r-