def __init__(self, options): def CommaStrParser(val): return [f.strip() for f in csv.reader([val]).next()] self.inclusions = CommaStrParser(options.include_files) self.exclusions = (CommaStrParser(options.exclude_files) + chromium_utils.FileExclusions()) self.regex_whitelist = FileRegexWhitelist(options) self.regex_blacklist = FileRegexBlacklist(options) self.exclude_unmatched = options.exclude_unmatched
def ShouldPackageFile(filename, target): """Returns true if the file should be a part of the resulting archive.""" if chromium_utils.IsMac(): file_filter = r'^.+\.(a|dSYM)$' elif chromium_utils.IsLinux(): file_filter = r'^.+\.(o|a|d)$' else: raise NotImplementedError('%s is not supported.' % sys.platform) if re.match(file_filter, filename): return False # Skip files that we don't care about. Mostly directories. things_to_skip = chromium_utils.FileExclusions() if filename in things_to_skip: return False return True
def ShouldPackageFile(filename, target): # Disable 'unused argument' warning for 'target' | pylint: disable=W0613 """Returns true if the file should be a part of the resulting archive.""" if chromium_utils.IsMac(): file_filter = '^.+\.(a|dSYM)$' elif chromium_utils.IsLinux(): file_filter = '^.+\.(o|a|d)$' elif chromium_utils.IsWindows(): file_filter = '^.+\.(obj|lib|pch|exp)$' else: raise NotImplementedError('%s is not supported.' % sys.platform) if re.match(file_filter, filename): return False # Skip files that we don't care about. Mostly directories. things_to_skip = chromium_utils.FileExclusions() if filename in things_to_skip: return False return True