Exemple #1
0
 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
Exemple #2
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=False, exclude=['examples']))
     return flags
Exemple #3
0
 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
Exemple #4
0
 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
Exemple #5
0
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
Exemple #6
0
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
Exemple #7
0
 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
Exemple #8
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
Exemple #9
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=False, exclude=["examples"]))
     return flags