qudi.util.helpers.iter_modules_recursive

qudi.util.helpers.iter_modules_recursive(paths: str | Iterable[str], prefix: str | None = '') List[ModuleInfo][source]

Has the same signature as pkgutil.iter_modules() but extends the functionality by walking through the entire directory tree and concatenating the return values of pkgutil.iter_modules() for each directory.

Additional modifications include: - Directories starting with “_” or “.” are ignored (including their sub-directories). - Python modules starting with a double-underscore (“__”) are excluded from the result.

Parameters:
pathsiterable

Iterable of root directories to start the search for modules.

prefixstr, optional

Prefix to prepend to all module names.

Returns:
iterable

Concatenated return values of pkgutil.iter_modules() for all directories in the tree.