template_interface#
- class confs.template_interface.Template[source]#
DESCRIPTION:
This is the base-class object for all file template rendering.
- read_tmpl(tmpl_path)[source]#
DESCRIPTION:
This method reads a template file path and returns a Python string containing the attributes collected from the file.
- Parameters:
- tmpl_path: str
A Python string defining the template file path.
- Returns:
- tmpl_str_in: str
A Python string containing the attributes collected from the template file path.
- Return type:
str
- write_tmpl(attr_dict, tmpl_path, template_path, fail_missing=False, f90_bool=False)[source]#
DESCRIPTION:
This method collects attribute values, renders a string containing template attributes, and writes the updated template to a specified file path tmpl_path.
- Parameters:
- attr_dict: Dict
A Python dictionary containing the attributes to be used for updating a specified template.
- tmpl_path: str
A Python string specifying the rendered (e.g., output) file path.
- template_path: str
A Python string specifying the template file path to be rendered.
- Return type:
None