'Filter filenames for package\'s data files in \'src_dir\''

def exclude_data_files(self, package, src_dir, files):

    globs = (self.exclude_package_data.get('', []) + self.exclude_package_data.get(package, []))
    bad = []
    for pattern in globs:
        bad.extend(fnmatch.filter(files, os.path.join(src_dir, convert_path(pattern))))
    bad = dict.fromkeys(bad)
    seen = {}
    return [f for f in files if ((f not in bad) and (f not in seen) and seen.setdefault(f, 1))]
