PNG  IHDR  8] PLTE S =tRNS   PNG  IHDR  8] PLTE S =tRNS   REDROOM
PHP 7.4.33
Preview: glob.py Size: 4.96 KB
/opt/alt/python27/lib/python2.7/site-packages/setuptools/glob.py

"""
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.

Changes include:
 * `yield from` and PEP3102 `*` removed.
 * Hidden files are not ignored.
"""

import os
import re
import fnmatch

__all__ = ["glob", "iglob", "escape"]


def glob(pathname, recursive=False):
    """Return 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.
    """
    return list(iglob(pathname, recursive=recursive))


def iglob(pathname, recursive=False):
    """Return 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.
    """
    it = _iglob(pathname, recursive)
    if recursive and _isrecursive(pathname):
        s = next(it)  # skip empty string
        assert not s
    return it


def _iglob(pathname, recursive):
    dirname, basename = os.path.split(pathname)
    if not has_magic(pathname):
        if basename:
            if os.path.lexists(pathname):
                yield pathname
        else:
            # Patterns ending with a slash should match only directories
            if os.path.isdir(dirname):
                yield pathname
        return
    if not dirname:
        if recursive and _isrecursive(basename):
            for x in glob2(dirname, basename):
                yield x
        else:
            for x in glob1(dirname, basename):
                yield x
        return
    # `os.path.split()` returns the argument itself as a dirname if it is a
    # drive or UNC path.  Prevent an infinite recursion if a drive or UNC path
    # contains magic characters (i.e. r'\\?\C:').
    if dirname != pathname and has_magic(dirname):
        dirs = _iglob(dirname, recursive)
    else:
        dirs = [dirname]
    if has_magic(basename):
        if recursive and _isrecursive(basename):
            glob_in_dir = glob2
        else:
            glob_in_dir = glob1
    else:
        glob_in_dir = glob0
    for dirname in dirs:
        for name in glob_in_dir(dirname, basename):
            yield os.path.join(dirname, name)


# These 2 helper functions non-recursively glob inside a literal directory.
# They return a list of basenames. `glob1` accepts a pattern while `glob0`
# takes a literal basename (so it only has to check for its existence).


def glob1(dirname, pattern):
    if not dirname:
        if isinstance(pattern, bytes):
            dirname = os.curdir.encode('ASCII')
        else:
            dirname = os.curdir
    try:
        names = os.listdir(dirname)
    except OSError:
        return []
    return fnmatch.filter(names, pattern)


def glob0(dirname, basename):
    if not basename:
        # `os.path.split()` returns an empty basename for paths ending with a
        # directory separator.  'q*x/' should match only directories.
        if os.path.isdir(dirname):
            return [basename]
    else:
        if os.path.lexists(os.path.join(dirname, basename)):
            return [basename]
    return []


# This helper function recursively yields relative pathnames inside a literal
# directory.


def glob2(dirname, pattern):
    assert _isrecursive(pattern)
    yield pattern[:0]
    for x in _rlistdir(dirname):
        yield x


# Recursively yields relative pathnames inside a literal directory.
def _rlistdir(dirname):
    if not dirname:
        if isinstance(dirname, bytes):
            dirname = os.curdir.encode('ASCII')
        else:
            dirname = os.curdir
    try:
        names = os.listdir(dirname)
    except os.error:
        return
    for x in names:
        yield x
        path = os.path.join(dirname, x) if dirname else x
        for y in _rlistdir(path):
            yield os.path.join(x, y)


magic_check = re.compile('([*?[])')
magic_check_bytes = re.compile(b'([*?[])')


def has_magic(s):
    if isinstance(s, bytes):
        match = magic_check_bytes.search(s)
    else:
        match = magic_check.search(s)
    return match is not None


def _isrecursive(pattern):
    if isinstance(pattern, bytes):
        return pattern == b'**'
    else:
        return pattern == '**'


def escape(pathname):
    """Escape all special characters.
    """
    # Escaping is done by wrapping any of "*?[" between square brackets.
    # Metacharacters do not work in the drive part and shouldn't be escaped.
    drive, pathname = os.path.splitdrive(pathname)
    if isinstance(pathname, bytes):
        pathname = magic_check_bytes.sub(br'[\1]', pathname)
    else:
        pathname = magic_check.sub(r'[\1]', pathname)
    return drive + pathname

Directory Contents

Dirs: 3 × Files: 68

Name Size Perms Modified Actions
command DIR
- drwxr-xr-x 2024-10-10 13:18:22
Edit Download
extern DIR
- drwxr-xr-x 2024-10-10 13:18:22
Edit Download
_vendor DIR
- drwxr-xr-x 2024-10-10 13:18:22
Edit Download
6.44 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
6.10 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
9.66 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
9.84 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
64.00 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
73.00 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
64.00 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
20.09 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
20.76 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
5.39 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
6.37 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
935 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
991 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
48.71 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
47.89 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
524 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
910 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.69 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
2.44 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
4.96 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
4.75 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
64.00 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
73.50 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
64.00 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
5.21 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
5.04 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
787 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.00 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.97 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
3.05 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
5.14 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
5.82 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
45.66 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
45.71 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
3.12 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
5.07 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
39.65 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
40.50 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.46 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
2.39 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
838 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.47 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.30 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.78 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
245 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
572 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
13.94 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
19.14 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
218 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
138 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
2.25 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.72 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
8.29 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
8.57 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
996 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.49 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
144 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
335 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
8.26 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
9.30 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
714 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
1.29 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
218 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
608 B lrw-r--r-- 2024-10-10 13:18:22
Edit Download
2.17 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
2.45 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
7.11 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download
9.41 KB lrw-r--r-- 2024-10-10 13:18:22
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
 !"#$%&'(()*+,-./00123456789 t\ wIDATx ]ys  47Y ƒ -  "  Rv  < f{Ɛ $k l L > L  ~h^ 1  [  r G t& h  l F z3O Y ! p A(_g̷ E8 )S 8 c  Kb"z ~ 5 J xAL WU <  *  5 m;W a pB h ~P J 2 3 6 ҙ .Ƹ P i  4g F R L P ΪK/D  M v (a3 k J Œ4N5* SH ` SdJ z  O J Xՠ V>u ߱ BE&L b2 ?2` tX+  c CB A$ i b C ĀMB E : /  # Dx &l =q Ty  0 \p I ( L Ǎ { e 4k ;`u^ヲ eP!( d {  )T A 8 O;Ě n >;s6 !  :Nx `[S D HU ~ q›J F} a g*D 49 / pn k h (t 8NxƐF _!r չ7 ZR R׷ q/5") Ӎ NY 0 x sZ!   o  fu  ,  K"$ ? pg  㕣=  1» {h " fh7    y  } € +7  $ y " X —ą - G P u 4 m >J 5 L =V ' ^@I p ?MS xЌ XV P ! h "C NS9B8̢ ]!K  e   zA , ӏkbY  !< XQ ٿyS| *" f { w  4@[S <  # 0 ! js [m  =,~ o "ݎ DHf Wo $ g ! Vԅ t mB /y Wf V4񺍸 c+@x?  B ~u " xUN e 0 BĂ) ~J pz! 7y6]l Ԥ@ P a< O /DHC `≻  N m"$  0ObB }{ x AO FCG D R ^ "B  { WDH  UR l@ T #  +"d T ; 0 i  D}. 7 ` ' ] w rE &S i ƕiTD EL P _ u h $ Ա FG wVD G L R Zf ' .!] J /ZR oGЍs Mr Ĥ ʬ 3 Q [3 cL ` ^ p + ( F;# B 5 '  2Y f [  ϶R0e }  E 7 6M aۮ H <& n % L] E}Up x紉, Uw' Q  Ǯշo k ވۙ 0N94 VX5 xEDE l D #֤ } C o )W :  ^ s 9  bRf iX5u ཱི 4 :[  T 1. | [E 2ؽ Iy\ : o x K G 5 ylP ' uK E ftb/i[3 .g _  [3M n G, #NwQ5~  ؚ) | n =Ц"x qg gB ` 듘 ~ x w ? ? R~  _ u. &VQ K˻   H C ( TN˄+ `C dA nB׭ D 3"Z G ê ^k H_ /- ~ " R_  .8 Z_ 6@ o  xg  uP ? 3լ @7AM!  E7^ - =V L  x  g-D0  CtmW 7  O  G _ WD0 g C  w1 r d w : a | \  *" f nֳ ^ H# f L ` Z ۽hV  }S F r0Ù Bć5r] @! NL iQ]{s^=4 d  WD  "  "   M; t" 8 5 e dL| "-*st" ) SWD ?R[S e ooF  20.D ? bo =) A i o d ģ ZҰaO @E =) i D a &ܟa CϞ y6 ,<%{^x%{f8? `iw^ ?/ M * IEND B`