K itdZddlmZddlZddlZddlZddlmZmZddl m Z m Z m Z e r ddl mZmZmZgdZdddZddd Zdd Ze dd Ze dd Zdd ZdZe d dZe d!dZd"dZe d#dZe d$dZd%dZej2dZej2dZd&dZd'dZdZy)(z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. ) annotationsN)IterableIterator) TYPE_CHECKINGAnyStroverload) BytesPathStrOrBytesPathStrPath)globiglobescapec.tt||S)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr )pathnamers U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/glob.pyr r s h)4 55cVt||}|rt|rt|}|rJ|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenext)rritss rr r %s/ ) $B\(+ H u Irc#(Ktjj|\}}|rt|rtnt }t |sJ|r$tjj|r|ytjj|r|y|s|||Ed{y||k7rt |r t||}n|g}t |st}|D]2}|||D]$}tjj||&4y7nwN) ospathsplitrglob2glob1 has_magiclexistsisdirrglob0join)rrdirnamebasename glob_in_dirdirsnames rrr7s h/GX$h)?%UK X  wwx( ww}}W% w111(y1!'!;y X  .2 .D'',,w- - .. 2sBD!D"A/Dcyrr'patterns rr!r![s8;rcyrr-r.s rr!r!]s>Arc|s@t|tr tjj d}ntj} tj |}tj||S#t $rgcYSwxYwNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)r'r/namess rr!r!_sh  gu %ii&&w/GiiG 7# >>% ))  sA// A=<A=c|s$tjj|r|gSgStjjtjj ||r|gSgSr)rrr$r#r&)r'r(s rr%r%msT  77== !:  I 77??277<<: ;:  Ircyrr-r.s rr r }sr`s# .22<< % 6$.H ; ; A A *   ? ? E E" 5 5 9 9%$bjj# BJJz*1 r