Skip to content

pre_gen_project

Pre Cookie Hook: Templated File with jinja2 syntax

get_context()

Get the Context, that was used by the Templating Engine at render time

Source code in src/cookiecutter_python/hooks/pre_gen_project.py
16
17
18
19
20
21
def get_context() -> OrderedDict:
    """Get the Context, that was used by the Templating Engine at render time"""
    # Templated Variables should be centralized here for easier inspection
    COOKIECUTTER: OrderedDict = OrderedDict()
    COOKIECUTTER = {{cookiecutter}}  # type: ignore    # pylint: disable=undefined-variable  # noqa: F821
    return COOKIECUTTER