Skip to content

preprocess

preprocess(path, fnames, dictionaries, comment="!!", add_header=True, path_build=None)

Preprocesses a list of template files and copies all remaining files in path to the build directory.

Parameters

path : str or Path
Directory containing template files.
fnames : str or list[str]
File name(s) to preprocess. Non-listed files are copied unchanged.
dictionaries : dict[str, str] or list[dict[str, str]]
Pragma replacement dictionaries, one per file. A single dict applies to all files.
comment : str, optional
Comment prefix marking pragmas. Default "!!".
add_header : bool, optional
Prepend auto-generated file header. Default True.
path_build : str, Path, or None, optional
Output directory, created if needed. Defaults to current working directory.