fmf_jinja.generators¶
Generators that consume the template and its data.
- class fmf_jinja.generators.FullGenerator(ctx)¶
Bases:
objectMain generator.
Processes the fmf tree and generates all output files
- ctx: TemplateContext¶
Current run context.
- property tree: Tree¶
Current fmf tree node.
- vars: dict[str, DataType]¶
- property sub_generators: list[SubGenerator]¶
Actual generators to execute.
- class fmf_jinja.generators.SubGenerator(parent)¶
Bases:
ABCGenerators that do the main work.
-
parent:
FullGenerator¶ Main generator run.
- property ctx: TemplateContext¶
Current run context.
- abstract classmethod from_fmf_data(parent, data)¶
Construct from the fmf data.
- Return type:
Self
-
parent:
- class fmf_jinja.generators.TemplateGenerator(parent, path, exclude=NOTHING, include_empty_folder=False)¶
Bases:
SubGeneratorJinja template generator.
Renders a jinja template or a whole folder.
-
path:
Path¶ Relative path to the template folder.
- property template_path: Path¶
Resolved path of the template.
- property template_dir: Path¶
Directory of the template: either path or its parent.
- classmethod from_fmf_data(parent, data)¶
Construct from the fmf data.
- Return type:
TemplateGenerator
-
path:
- class fmf_jinja.generators.SymlinkGenerator(parent, symlinks)¶
Bases:
SubGeneratorSymbolic link generator.
Creates symbolic links with the context of the fmf tree.
-
symlinks:
dict[str,Path]¶ Symbolic links to generate
- The dict structure is:
key: path to the symbolic link generated
value: target where the symbolic link points to
- classmethod from_fmf_data(parent, data)¶
Construct from the fmf data.
- Return type:
-
symlinks:
- class fmf_jinja.generators.CopyGenerator(parent, files)¶
Bases:
SubGeneratorCopy generator.
Copies files with the context of the fmf tree.
- classmethod from_fmf_data(parent, data)¶
Construct from the fmf data.
- Return type: