pyccel.codegen.wrappergen module#
A module containing the Wrappergen class which is responsible for the generation of wrapper files.
- class pyccel.codegen.wrappergen.Wrappergen(codegen, name, language, verbose)[source]#
Bases:
object
A class which handles the generation of wrapper files.
A class which handles the generation of wrapper files. These files are necessary so the generated code can be called from Python.
- Parameters:
codegen (Codegen) – The printer which was used to print the translated code.
name (str) – Name of the generated module or program.
language (str) – The language which the printer should print to.
verbose (int) – The level of verbosity.
- get_additional_imports()[source]#
Get the objects that were imported by the codeprinters.
Get the objects that were imported by the codeprinters. These imports may affect the necessary compiler commands.
- Returns:
A dictionary for each printed wrapper file, mapping the include strings to the import module.
- Return type:
list[dict[str, Import]]
- print(dirpath)[source]#
Print the wrapper code.
Print the AST objects generated by a call to the wrap() function.
- Parameters:
dirpath (str | Path) – The path to the directory where files should be printed.
- Returns:
A list of the source files printed by this function (this is not equivalent to all files printed by this function as headers are excluded).
- Return type:
list[Path]
- property printed_languages#
Get a list of the languages used in the wrappers.
Get a list of the languages in which each of the wrapper files was printed.