def _build_python_files(pkg, top_node): python_files = [] for p in get_packages(pkg, top_node): python_files.extend(find_package(p, top_node)) for m in pkg.py_modules: node = top_node.find_node("%s.py" % m) python_files.append(node.path_from(node)) py_section = InstalledSection("pythonfiles", "library", "$_srcrootdir", "$sitedir", python_files) return {"library": py_section}
def prune_extra_files(files, pkg, top_node): package_files = [] for p in pkg.packages: package_files.extend(find_package(p, top_node)) data_files = [] for data_section in pkg.data_files.values(): data_files.extend([os.path.join(data_section.source_dir, f) for f in data_section.files]) redundant = package_files + data_files + pkg.py_modules return prune_file_list(files, redundant)
def prune_extra_files(files, pkg): package_files = [] for p in pkg.packages: package_files.extend(find_package(p)) data_files = [] for sec in pkg.data_files: srcdir_field = pkg.data_files[sec]['srcdir'] files_field = pkg.data_files[sec]['files'] data_files.extend([os.path.join(srcdir_field, f) for f in files_field]) redundant = package_files + data_files + pkg.py_modules return prune_file_list(files, redundant)
self.config_py = unnormalize_path(config_py) else: self.config_py = config_py def file_list(pkg, top_node): root_src = top_node.abspath() files = [] for entry in pkg.extra_source_files: try: files.extend(expand_glob(entry, root_src)) except IOError, e: raise InvalidPackage("Error in ExtraSourceFiles entry: %s" % e) for p in get_packages(pkg, top_node): files.extend(find_package(p, top_node)) for m in pkg.py_modules: m_node = top_node.find_node("%s.py" % m) files.append(m_node.path_from(top_node)) extensions = get_extensions(pkg, top_node) libraries = get_compiled_libraries(pkg, top_node) for e in extensions.values() + libraries.values(): for source in e.sources: node = top_node.find_node(source) files.append(node.path_from(top_node)) for section in pkg.data_files.values(): for entry in section.files: for f in expand_glob(entry, os.path.join(root_src, section.source_dir)): node = top_node.find_node(os.path.join(section.source_dir, f))