def inc_lib_flags(self, libdirs, recursive=False): flags = SpaceList() for d in libdirs: flags.append('-I' + d) if recursive: flags.extend('-I' + subd for subd in list_subdirs(d, recursive=True, exclude=['examples'])) return flags
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=False, exclude=['examples'])) return flags
def recursive_inc_lib_flags(self, libdirs): flags = SpaceList() for d in libdirs: flags.append('-I' + d) # recursive=True creates so many include directories that it exceeds avg-gcc's maximum list length. flags.extend('-I' + subd for subd in list_subdirs(d, recursive=False, exclude=['examples'])) return flags
def recursive_inc_lib_flags(self, libdirs): flags = SpaceList() for d in libdirs: flags.append('-I' + d) # recursive=True creates so many include directories that it exceeds avg-gcc's maximum list length. flags.extend('-I' + subd for subd in list_subdirs( d, recursive=False, exclude=['examples'])) return flags
def glob(dir, *patterns, **kwargs): recursive = kwargs.get('recursive', True) subdir = kwargs.get('subdir', '') result = SpaceList() scan_dir = os.path.join(dir, subdir) for entry in os.listdir(scan_dir): path = os.path.join(scan_dir, entry) if os.path.isdir(path) and recursive: subglob = glob(dir, *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), dir)) return result
def glob(dir, *patterns, **kwargs): recursive = kwargs.get('recursive', True) subdir = kwargs.get('subdir', '') result = SpaceList() scan_dir = os.path.join(dir, 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(dir, *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), dir)) return result
def recursive_inc_lib_flags(self, dashcmd, libdirs): flags = SpaceList() for d in libdirs: flags.append(dashcmd + d) flags.extend(dashcmd + subd for subd in list_subdirs(d, recursive=True, exclude=['examples'])) return flags
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
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=False, exclude=["examples"])) return flags