xopto.mcbase.mcsrc module

RE_LICENSE = re.compile('/\\*+ Begin license [ a-zA-Z0-3.,;:,.\\*\n\r\t()/<>]* End license \\*+/')

Compiled regular expression that matches the file header - license text.

fuse(inputs: List[str], output: str, striplicense: bool = False, verbose: bool = False)str[source]

Fuses the source files in inputs into the template defined by the output.

Parameters
  • inputs (List[str]) – A list of source files to fuse.

  • output (str) – Output template file.

  • striplicense (bool) – Strip the license headers if set to True.

  • verbose (bool) – Turns on verbose reporting.

Note

The include directives are excluded/commented before fusing the content of source files into the template. The data context keys are obtained by replacing all dots in the source file names with underscores. The output template file should therefore reference the source files as “src_h” instead of “src.h”.