Ejemplo n.º 1
0
 def recursive_inc_lib_flags(self, libdirs):
     flags = SpaceList()
     for d in libdirs:
         flags.append('-I' + d)
         flags.extend('-I' + subd for subd in list_subdirs(
             d, recursive=True, exclude=['examples', 'extras']))
     return flags
Ejemplo n.º 2
0
def glob(dirname, *patterns, **kwargs):
    recursive = kwargs.get('recursive', True)
    subdir = kwargs.get('subdir', '')

    result = SpaceList()
    scan_dir = os.path.join(dirname, subdir)
    if not os.path.isdir(scan_dir):
        return result

    for entry in os.listdir(scan_dir):
        path = os.path.join(scan_dir, entry)
        if os.path.isdir(path) and recursive:
            subglob = glob(dirname, *patterns, recursive=True,
                           subdir=os.path.join(subdir, entry))
            result.extend(subglob)
        elif os.path.isfile(path) and any(fnmatch.fnmatch(entry, p) for p in patterns):
            result.append(GlobFile(os.path.join(subdir, entry), dirname))

    return result
Ejemplo n.º 3
0
def glob(dirname, *patterns, **kwargs):
    recursive = kwargs.get('recursive', True)
    subdir = kwargs.get('subdir', '')

    result = SpaceList()
    scan_dir = os.path.join(dirname, subdir)
    if not os.path.isdir(scan_dir):
        return result

    for entry in os.listdir(scan_dir):
        path = os.path.join(scan_dir, entry)
        if os.path.isdir(path) and recursive:
            subglob = glob(dirname, *patterns, recursive=True,
                           subdir=os.path.join(subdir, entry))
            result.extend(subglob)
        elif os.path.isfile(path) and any(fnmatch.fnmatch(entry, p) for p in patterns):
            result.append(GlobFile(os.path.join(subdir, entry), dirname))

    return result
Ejemplo n.º 4
0
 def recursive_inc_lib_flags(self, libdirs):
     flags = SpaceList()
     for d in libdirs:
         flags.append('-I' + d)
         flags.extend('-I' + subd for subd in list_subdirs(d, recursive=True, exclude=['examples', 'extras']))
     return flags